test(core): fix windows test failure by mocking process.platform in ripgrep fallback tests

This commit is contained in:
Coco Sheng
2026-05-12 14:12:31 -04:00
parent 5bcc400020
commit f271fcd172

View File

@@ -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 () => {