From f271fcd172e2cfc99a9cb9d99fc68e7bb956edd1 Mon Sep 17 00:00:00 2001 From: Coco Sheng Date: Tue, 12 May 2026 14:12:31 -0400 Subject: [PATCH] test(core): fix windows test failure by mocking process.platform in ripgrep fallback tests --- packages/core/src/tools/ripGrep.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/core/src/tools/ripGrep.test.ts b/packages/core/src/tools/ripGrep.test.ts index ce44cd85a5..aeae7688f7 100644 --- a/packages/core/src/tools/ripGrep.test.ts +++ b/packages/core/src/tools/ripGrep.test.ts @@ -1797,6 +1797,18 @@ describe('resolveRipgrepPath', () => { beforeEach(() => { vi.spyOn(os, 'platform').mockReturnValue('linux'); vi.spyOn(os, 'arch').mockReturnValue('x64'); + vi.stubGlobal( + 'process', + Object.create(process, { + platform: { + get: () => 'linux', + }, + }), + ); + }); + + afterEach(() => { + vi.unstubAllGlobals(); }); it('should resolve the SEA (flattened) path first', async () => {