Skip to content

Commit a07a6ac

Browse files
committed
fixup! fs: add fsPromises.watch()
1 parent a8ea9e3 commit a07a6ac

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

test/parallel/test-fs-promises-watch.js

-31
Original file line numberDiff line numberDiff line change
@@ -113,34 +113,3 @@ assert.rejects(
113113
assert.strictEqual(err.name, 'AbortError');
114114
}
115115
})().then(common.mustCall());
116-
117-
fs.rmdirSync(tmpdir.path, { recursive: true });
118-
tmpdir.refresh();
119-
120-
for (const testCase of kCases) {
121-
if (testCase.shouldSkip) continue;
122-
fs.mkdirSync(testCase.dirPath);
123-
// Long content so it's actually flushed.
124-
const content1 = Date.now() + testCase.fileName.toLowerCase().repeat(1e4);
125-
fs.writeFileSync(testCase.filePath, content1);
126-
127-
const ac = new AbortController();
128-
129-
async function test() {
130-
const { signal } = ac;
131-
const watcher = watch(testCase[testCase.field], { signal });
132-
assert.rejects(watcher.next(), {
133-
name: 'AbortError'
134-
});
135-
}
136-
137-
// Long content so it's actually flushed. toUpperCase so there's real change.
138-
const content2 = Date.now() + testCase.fileName.toUpperCase().repeat(1e4);
139-
setImmediate(() => {
140-
fs.writeFileSync(testCase.filePath, '');
141-
fs.writeFileSync(testCase.filePath, content2);
142-
ac.abort();
143-
});
144-
145-
test().then(common.mustCall());
146-
}

0 commit comments

Comments
 (0)