Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! fs: add fsPromises.watch()
  • Loading branch information
jasnell committed Feb 15, 2021
commit 6e27a093b8097d28963b7ab854f12dca5cb2c71b
31 changes: 0 additions & 31 deletions test/parallel/test-fs-promises-watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,34 +113,3 @@ assert.rejects(
assert.strictEqual(err.name, 'AbortError');
}
})().then(common.mustCall());

fs.rmdirSync(tmpdir.path, { recursive: true });
tmpdir.refresh();

for (const testCase of kCases) {
if (testCase.shouldSkip) continue;
fs.mkdirSync(testCase.dirPath);
// Long content so it's actually flushed.
const content1 = Date.now() + testCase.fileName.toLowerCase().repeat(1e4);
fs.writeFileSync(testCase.filePath, content1);

const ac = new AbortController();

async function test() {
const { signal } = ac;
const watcher = watch(testCase[testCase.field], { signal });
assert.rejects(watcher.next(), {
name: 'AbortError'
});
}

// Long content so it's actually flushed. toUpperCase so there's real change.
const content2 = Date.now() + testCase.fileName.toUpperCase().repeat(1e4);
setImmediate(() => {
fs.writeFileSync(testCase.filePath, '');
fs.writeFileSync(testCase.filePath, content2);
ac.abort();
});

test().then(common.mustCall());
}