From 1bfb5ac612abfcbcc9d2274aa2e009b67140e438 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Tue, 6 Oct 2026 17:58:42 +0200 Subject: [PATCH] test: fix flaky test --- test/e2e/test/recorded-deps.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/e2e/test/recorded-deps.test.ts b/test/e2e/test/recorded-deps.test.ts index 106c8eb79..edd618864 100644 --- a/test/e2e/test/recorded-deps.test.ts +++ b/test/e2e/test/recorded-deps.test.ts @@ -774,7 +774,7 @@ test('a run of the affected tests keeps the records of the other tests', async ( }) test('a rerun of one file in watch mode keeps the records of the other files', async () => { - const { ctx, fs, stderr } = await runInlineTests( + const { ctx, fs, stderr, vitest } = await runInlineTests( { 'src/helper.js': 'export {}', 'src/other.js': 'export {}', @@ -784,16 +784,19 @@ test('a rerun of one file in watch mode keeps the records of the other files', a { ...config, watch: true }, ) expect(stderr).toBe('') + await vitest.waitForStdout('Waiting for file changes') + vitest.resetOutput() fs.editFile('a.test.js', (content) => content.replace('src/helper.js', 'src/other.js')) - await ctx!.rerunFiles([fs.resolveFile('a.test.js')]) + await vitest.waitForStdout('RERUN') + await vitest.waitForStdout('Waiting for file changes') expect(readDependencies(ctx)).toMatchInlineSnapshot(` { "": { "a.test.js": [ "a.test.js", - "src/helper.js", + "src/other.js", ], "b.test.js": [ "b.test.js", -- 2.54.0