test(file): stabilize watcher maxDepth event wait

Signed-off-by: Pleasurecruise <3196812536@qq.com>
This commit is contained in:
Pleasurecruise
2026-07-07 12:10:03 +08:00
parent 75fac923df
commit f57e91c8d0

View File

@@ -170,8 +170,9 @@ describe('createDirectoryWatcher', () => {
const rootFile = path.join(dir, 'root.txt') as FilePath
const nestedFile = path.join(nestedDir, 'nested.txt') as FilePath
const rootAdd = waitForEvent(w, (e) => e.kind === 'add' && e.path === rootFile)
await writeFile(rootFile, 'root')
await waitForEvent(w, (e) => e.kind === 'add' && e.path === rootFile)
await rootAdd
await writeFile(nestedFile, 'nested')
await new Promise((r) => setTimeout(r, 400))