mirror of
https://github.com/denoland/deno.git
synced 2024-12-30 11:16:38 -05:00
9a10668694
Although not easy to replicate in the wild, the `deno test` op sanitizer can fail when there are intervals that started before a test runs, since the op sanitizer can end up running in the time between the timer op for an interval's run resolves and the op for the next run starts. This change fixes that by adding a new macrotask callback that will run after the timer macrotask queue has drained. This ensures that there is a timer op if there are any timers which are unresolved by the time the op sanitizer runs.
11 lines
322 B
TypeScript
11 lines
322 B
TypeScript
import { nextTick } from "../../../../test_util/std/node/_next_tick.ts";
|
|
|
|
// https://github.com/denoland/deno_std/issues/1651
|
|
|
|
Deno.test("test 1", async () => {
|
|
await new Promise<void>((resolve) => nextTick(resolve));
|
|
});
|
|
|
|
Deno.test("test 2", async () => {
|
|
await new Promise<void>((resolve) => nextTick(resolve));
|
|
});
|