0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

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.
This commit is contained in:
Bert Belder 2021-10-11 00:43:35 +02:00
parent 22d6e43c37
commit 62f43030b4
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461

View file

@ -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.