diff --git a/tests/unit/utils/rules-proxy.test.ts b/tests/unit/utils/rules-proxy.test.ts index 2d6992d3328..182d77e00c1 100644 --- a/tests/unit/utils/rules-proxy.test.ts +++ b/tests/unit/utils/rules-proxy.test.ts @@ -33,6 +33,17 @@ describe('createRewriter', () => { jwtSecret, projectDir, }) + // createRewriter doesn't wait for its file watchers, and a write before they're ready is never reported. + await Promise.all( + getWatchers().map( + (watcher) => + new Promise((resolve) => { + watcher.once('ready', () => { + resolve() + }) + }), + ), + ) return { projectDir, rewriter } }