diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2020-03-24 20:50:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 23:50:51 -0400 |
commit | addfdc4cd0ffa0e0f6b284379c8873a202af7d5b (patch) | |
tree | 97a2a03904b009848be4ea0f16e3941d0948965c /cli/js | |
parent | 07fc95aceee950316500cf2d770317b6e993356e (diff) |
fix: add fsEvent notify::Error casts (#4488)
Diffstat (limited to 'cli/js')
-rw-r--r-- | cli/js/tests/fs_events_test.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cli/js/tests/fs_events_test.ts b/cli/js/tests/fs_events_test.ts index b1697971a..8494bf6af 100644 --- a/cli/js/tests/fs_events_test.ts +++ b/cli/js/tests/fs_events_test.ts @@ -14,6 +14,26 @@ unitTest({ perms: { read: false } }, function fsEventsPermissions() { assert(thrown); }); +unitTest({ perms: { read: true } }, function fsEventsInvalidPath() { + let thrown = false; + try { + Deno.fsEvents("non-existant.file"); + } catch (err) { + console.error(err); + if (Deno.build.os === "win") { + assert( + err.message.includes( + "Input watch path is neither a file nor a directory" + ) + ); + } else { + assert(err instanceof Deno.errors.NotFound); + } + thrown = true; + } + assert(thrown); +}); + async function getTwoEvents( iter: AsyncIterableIterator<Deno.FsEvent> ): Promise<Deno.FsEvent[]> { |