mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 05:04:48 +00:00
refactor: proper Node polyfill directory iteration now that Deno supports this (#4783)
This commit is contained in:
parent
f2d1bc3af3
commit
1cd1f7de70
2 changed files with 18 additions and 36 deletions
|
@ -90,6 +90,7 @@ test({
|
|||
}
|
||||
);
|
||||
const thirdRead: Dirent | null = await dir.read();
|
||||
const fourthRead: Dirent | null = await dir.read();
|
||||
|
||||
if (firstRead?.name === "foo.txt") {
|
||||
assertEquals(secondRead?.name, "bar.txt");
|
||||
|
@ -100,6 +101,7 @@ test({
|
|||
}
|
||||
assert(secondCallback);
|
||||
assert(thirdRead === null);
|
||||
assert(fourthRead === null);
|
||||
} finally {
|
||||
Deno.removeSync(testDir, { recursive: true });
|
||||
}
|
||||
|
@ -120,6 +122,7 @@ test({
|
|||
const firstRead: Dirent | null = dir.readSync();
|
||||
const secondRead: Dirent | null = dir.readSync();
|
||||
const thirdRead: Dirent | null = dir.readSync();
|
||||
const fourthRead: Dirent | null = dir.readSync();
|
||||
|
||||
if (firstRead?.name === "foo.txt") {
|
||||
assertEquals(secondRead?.name, "bar.txt");
|
||||
|
@ -129,6 +132,7 @@ test({
|
|||
fail("File not found during read");
|
||||
}
|
||||
assert(thirdRead === null);
|
||||
assert(fourthRead === null);
|
||||
} finally {
|
||||
Deno.removeSync(testDir, { recursive: true });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue