- segfault reading stacktrace from `fs/promises` rejections
- `Promise` rejection within `describe()` ends testing abruptly
- `FSSink.write()` incorrectly handles `objectMode`
- `FSSink.write()` throws wrong error codes
This commit is contained in:
Alex Lam S.L
2023-01-15 02:50:55 +02:00
committed by GitHub
parent d01ec47529
commit 136014b13a
4 changed files with 54 additions and 22 deletions

View File

@@ -478,7 +478,7 @@ pub const TestCommand = struct {
if (reporter.summary.expectations > 0) Output.prettyError(" {d:5>} expect() calls\n", .{reporter.summary.expectations});
Output.prettyError(
\\ Ran {d} tests across {d} files
\\ Ran {d} tests across {d} files
, .{
reporter.summary.fail + reporter.summary.pass,
test_files.len,
@@ -593,8 +593,8 @@ pub const TestCommand = struct {
module.runTests(JSC.JSValue.zero, vm.global);
vm.eventLoop().tick();
const initial_unhandled_counter = vm.unhandled_error_counter;
while (vm.active_tasks > 0 and vm.unhandled_error_counter == initial_unhandled_counter) {
var prev_unhandled_count = vm.unhandled_error_counter;
while (vm.active_tasks > 0) {
if (!jest.Jest.runner.?.has_pending_tests) jest.Jest.runner.?.drain();
vm.eventLoop().tick();
@@ -603,6 +603,11 @@ pub const TestCommand = struct {
if (!jest.Jest.runner.?.has_pending_tests) break;
vm.eventLoop().tick();
}
while (prev_unhandled_count < vm.unhandled_error_counter) {
vm.global.handleRejectedPromises();
prev_unhandled_count = vm.unhandled_error_counter;
}
}
_ = vm.global.vm().runGC(false);
}