diff options
Diffstat (limited to 'std/node/process_test.ts')
-rw-r--r-- | std/node/process_test.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/std/node/process_test.ts b/std/node/process_test.ts index 6e6145e67..ee566853e 100644 --- a/std/node/process_test.ts +++ b/std/node/process_test.ts @@ -5,6 +5,7 @@ import { assert, assertEquals, assertThrows } from "../testing/asserts.ts"; import * as path from "../path/mod.ts"; import * as all from "./process.ts"; import { argv, env } from "./process.ts"; +import { delay } from "../async/delay.ts"; // NOTE: Deno.execPath() (and thus process.argv) currently requires --allow-env // (Also Deno.env.toObject() (and process.env) requires --allow-env but it's more obvious) @@ -164,3 +165,23 @@ Deno.test({ // assert(process.stderr.isTTY); }, }); + +Deno.test({ + name: "process.nextTick", + async fn() { + let withoutArguments = false; + process.nextTick(() => { + withoutArguments = true; + }); + + const expected = 12; + let result; + process.nextTick((x: number) => { + result = x; + }, 12); + + await delay(10); + assert(withoutArguments); + assertEquals(result, expected); + }, +}); |