From 4efb33c86ac15cb4b8b2486bcc947b0e6d5a90dd Mon Sep 17 00:00:00 2001 From: Nikita Hrytsai Date: Thu, 13 Feb 2025 18:54:46 +0200 Subject: [PATCH] In tests check for SIGTERM signal after nvimProcess.kill() --- node/test/preamble.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/node/test/preamble.ts b/node/test/preamble.ts index 45f8fba..eb80c6f 100644 --- a/node/test/preamble.ts +++ b/node/test/preamble.ts @@ -38,7 +38,7 @@ export async function withNvimProcess(fn: (sock: string) => Promise) { }); nvimProcess.on("exit", (code, signal) => { - if (code !== 1) { + if (code !== 1 && signal !== "SIGTERM") { throw new Error( `Nvim process exited with code ${code} and signal ${signal}`, ); @@ -187,5 +187,8 @@ export function extractMountTree(mounted: MountedVDOM): unknown { process.on("uncaughtException", (err) => { console.error(err); - process.exit(1); + // Give time for error to be printed. + setTimeout(() => { + process.exit(1); + }, 50); });