diff options
Diffstat (limited to 'src/cli/test_command.zig')
-rw-r--r-- | src/cli/test_command.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cli/test_command.zig b/src/cli/test_command.zig index 1927e6027..7b5c88947 100644 --- a/src/cli/test_command.zig +++ b/src/cli/test_command.zig @@ -482,10 +482,13 @@ pub const TestCommand = struct { var modules: []*Jest.DescribeScope = reporter.jest.files.items(.module_scope)[file_start..]; for (modules) |module| { + vm.onUnhandledRejectionCtx = null; + vm.onUnhandledRejection = Jest.TestRunnerTask.onUnhandledRejection; module.runTests(JSC.JSValue.zero, vm.global); vm.eventLoop().tick(); - while (vm.active_tasks > 0) { + const initial_unhandled_counter = vm.unhandled_error_counter; + while (vm.active_tasks > 0 and vm.unhandled_error_counter == initial_unhandled_counter) { if (!Jest.Jest.runner.?.has_pending_tests) Jest.Jest.runner.?.drain(); vm.eventLoop().tick(); |