Parcourir la source

test(hmr): separate repeated watcher failures

Tianyi Cui il y a 2 mois
Parent
commit
e94cacd088
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      packages/boot/app-boot/tests/hmr-config.spec.ts

+ 3 - 0
packages/boot/app-boot/tests/hmr-config.spec.ts

@@ -185,6 +185,9 @@ describe('HMR exact config paths', () => {
       expect(observed.error).toBeInstanceOf(Error)
       expect(observed.error.message).toBe('42')
 
+      // Let Chokidar's atomic-write window close before requiring a distinct
+      // second notification from the same path.
+      await new Promise(resolve => setTimeout(resolve, 250))
       writeFileSync(filename, 'invalid again')
       await eventually(() => failureCount === 2, 'HMR stopped broadcasting after an observer rejected')
     } finally {