diff options
Diffstat (limited to 'tests/unit_node/_fs')
-rw-r--r-- | tests/unit_node/_fs/_fs_watch_test.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit_node/_fs/_fs_watch_test.ts b/tests/unit_node/_fs/_fs_watch_test.ts index 01236a493..8e2fb619c 100644 --- a/tests/unit_node/_fs/_fs_watch_test.ts +++ b/tests/unit_node/_fs/_fs_watch_test.ts @@ -38,3 +38,17 @@ Deno.test({ unwatchFile(file); }, }); + +Deno.test({ + name: "watch.unref() should work", + sanitizeOps: false, + sanitizeResources: false, + async fn() { + const file = Deno.makeTempFileSync(); + const watcher = watch(file, () => {}); + // Wait for the watcher to be initialized + await wait(10); + // @ts-ignore node types are outdated in deno. + watcher.unref(); + }, +}); |