diff options
Diffstat (limited to 'tests/unit_node/_fs')
-rw-r--r-- | tests/unit_node/_fs/_fs_watch_test.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/unit_node/_fs/_fs_watch_test.ts b/tests/unit_node/_fs/_fs_watch_test.ts index 01df80f97..01236a493 100644 --- a/tests/unit_node/_fs/_fs_watch_test.ts +++ b/tests/unit_node/_fs/_fs_watch_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { watch } from "node:fs"; +import { unwatchFile, watch, watchFile } from "node:fs"; import { assertEquals } from "@std/assert/mod.ts"; function wait(time: number) { @@ -25,3 +25,16 @@ Deno.test({ assertEquals(result.length >= 1, true); }, }); + +Deno.test({ + name: "watching a file with options", + async fn() { + const file = Deno.makeTempFileSync(); + watchFile( + file, + () => {}, + ); + await wait(100); + unwatchFile(file); + }, +}); |