Skip to content

Commit a5f5f28

Browse files
committed
chore(test): Fixed watchChange test helper for the internal differences between watchpak 2.1.1 and 2.4.0
1 parent 140ea64 commit a5f5f28

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

tests/unit/test.watcher.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,17 @@ describe('watcher', () => {
5353

5454
// $FlowIgnore: retrieve internal Watchpack properties for testing purpose.
5555
const {fileWatchers, directoryWatchers} = watcher;
56-
let watchedFile;
57-
let watchedDir;
56+
let watchedFilePath;
57+
let watchedDirPath;
5858

5959
if (fileWatchers?.size > 0) {
60-
watchedFile = Array.from(fileWatchers.values())[0];
60+
watchedFilePath = Array.from(fileWatchers.keys())[0];
6161
}
6262

6363
if (directoryWatchers?.size > 0) {
64-
watchedDir = Array.from(directoryWatchers.values())[0];
64+
watchedDirPath = Array.from(directoryWatchers.keys())[0];
6565
}
6666

67-
const watchedFilePath = watchedFile && watchedFile.path;
68-
const watchedDirPath = watchedDir && watchedDir.path;
69-
7067
await fs.utimes(someFile, Date.now() / 1000, Date.now() / 1000);
7168
const assertParams = {
7269
onChange,

0 commit comments

Comments
 (0)