fix(runtime): handle expected exitCode rejection after terminating timed out test processes
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tstest',
|
||||
version: '3.5.0',
|
||||
version: '3.5.1',
|
||||
description: 'A powerful, modern test runner for TypeScript with multi-runtime support (Node.js, Deno, Bun, Chromium) and a batteries-included test framework.'
|
||||
}
|
||||
|
||||
@@ -184,6 +184,8 @@ import '${absoluteTestFile.replace(/\\/g, '/')}';
|
||||
timeoutId = setTimeout(async () => {
|
||||
// Use tsrun's terminate() to gracefully kill the process
|
||||
await tsrunProcess.terminate();
|
||||
// Swallow the expected rejection from the killed child process
|
||||
tsrunProcess.exitCode.catch(() => {});
|
||||
reject(new Error(`Test file timed out after ${this.timeoutSeconds} seconds`));
|
||||
}, timeoutMs);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user