mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-07 23:33:14 +08:00
test(file): stabilize watcher maxDepth event wait
Signed-off-by: Pleasurecruise <3196812536@qq.com>
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user