diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-03-20 11:19:53 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-20 11:19:53 +0530 |
commit | 5b2f689f085fea8ff52f296c94072a1fb29dd054 (patch) | |
tree | d62a9b77c76055f68e96392f16ddb84820f198ac /tests/unit_node/_fs | |
parent | 737adbe1b076cda299131704520e9fe2d41b7611 (diff) |
fix(ext/node): FsWatcher ref and unref (#22987)
Fixes https://github.com/denoland/deno/issues/22973
---------
Co-authored-by: Satya Rohith <me@satyarohith.com>
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(); + }, +}); |