diff options
author | Bert Belder <bertbelder@gmail.com> | 2021-10-11 00:43:35 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2021-10-17 15:12:48 +0200 |
commit | 62f43030b455508d4cd57603f9ed641fe609d0cd (patch) | |
tree | 54782457b6884cc6883e3f10a5d61bd6da8c54a9 | |
parent | 22d6e43c37d5a821b0487e927070eb191da3c470 (diff) |
chore(cli/tests): fix flaky fs watcher tests (#12385)
On OS X, the watcher sometimes witnesses the creation of it's own root
directory. Creating that directory using a sync op instead of an async
op sidesteps the issue.
-rw-r--r-- | cli/tests/unit/fs_events_test.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/tests/unit/fs_events_test.ts b/cli/tests/unit/fs_events_test.ts index 8da041885..497c421fa 100644 --- a/cli/tests/unit/fs_events_test.ts +++ b/cli/tests/unit/fs_events_test.ts @@ -39,7 +39,7 @@ async function getTwoEvents( unitTest( { permissions: { read: true, write: true } }, async function watchFsBasic() { - const testDir = await Deno.makeTempDir(); + const testDir = Deno.makeTempDirSync(); const iter = Deno.watchFs(testDir); // Asynchornously capture two fs events. @@ -66,7 +66,7 @@ unitTest( unitTest( { permissions: { read: true, write: true } }, async function watchFsReturn() { - const testDir = await Deno.makeTempDir(); + const testDir = Deno.makeTempDirSync(); const iter = Deno.watchFs(testDir); // Asynchronously loop events. @@ -84,7 +84,7 @@ unitTest( unitTest( { permissions: { read: true, write: true } }, async function watchFsClose() { - const testDir = await Deno.makeTempDir(); + const testDir = Deno.makeTempDirSync(); const iter = Deno.watchFs(testDir); // Asynchronously loop events. |