mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
test: ignore unrelated events in FW watch tests
Change assertions on `test-fs-watch-recursive-add-*` tests to only take into account change events that match the file. PR-URL: https://github.com/nodejs/node/pull/55605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
4da8d110f3
commit
42f465972a
5 changed files with 16 additions and 32 deletions
|
@ -40,9 +40,8 @@ const relativePath = path.join(file, path.basename(subfolderPath), childrenFile)
|
|||
const watcher = fs.watch(testDirectory, { recursive: true });
|
||||
let watcherClosed = false;
|
||||
watcher.on('change', function(event, filename) {
|
||||
assert.strictEqual(event, 'rename');
|
||||
|
||||
if (filename === relativePath) {
|
||||
assert.strictEqual(event, 'rename');
|
||||
watcher.close();
|
||||
watcherClosed = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue