[bun:test] Remove waitForPromise in describe(label, async () => {})

This commit is contained in:
Jarred Sumner
2024-10-04 02:23:58 -07:00
parent adc86c773b
commit b4e81a4e53
8 changed files with 170 additions and 32 deletions

View File

@@ -1234,19 +1234,20 @@ pub const TestCommand = struct {
}
const file_end = reporter.jest.files.len;
const global = vm.global;
for (file_start..file_end) |module_id| {
const module: *jest.DescribeScope = reporter.jest.files.items(.module_scope)[module_id];
vm.onUnhandledRejectionCtx = null;
vm.onUnhandledRejection = jest.TestRunnerTask.onUnhandledRejection;
module.runTests(vm.global);
module.runTests(global);
vm.eventLoop().tick();
var prev_unhandled_count = vm.unhandled_error_counter;
while (vm.active_tasks > 0) : (vm.eventLoop().flushImmediateQueue()) {
if (!jest.Jest.runner.?.has_pending_tests) {
jest.Jest.runner.?.drain();
jest.Jest.runner.?.drain(global);
}
vm.eventLoop().tick();