Skip to content

Commit 1b1de36

Browse files
committed
chore: fix detect spec to use actual implementation of cp.spawn
1 parent bc821e8 commit 1b1de36

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/launcher/test/unit/detect.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ describe('detect', () => {
6969
vi.mocked(linuxDetect).mockImplementation(linuxDetectActual)
7070
vi.mocked(darwinDetect).mockImplementation(darwinDetectActual)
7171
vi.mocked(windowsDetect).mockImplementation(windowsDetectActual)
72+
73+
const { spawn } = await vi.importActual<typeof import('child_process')>('child_process')
74+
75+
vi.mocked(cp.spawn).mockImplementation(spawn)
7276
})
7377

7478
// making simple to debug tests
@@ -98,7 +102,7 @@ describe('detect', () => {
98102
describe('#getMajorVersion', () => {
99103
it('parses major version from provided string', () => {
100104
expect(getMajorVersion('123.45.67')).toEqual('123')
101-
expect(getMajorVersion('Browser 77.1.0')).to.eq('Browser 77')
105+
expect(getMajorVersion('Browser 77.1.0')).toEqual('Browser 77')
102106
expect(getMajorVersion('999')).toEqual('999')
103107
})
104108
})
@@ -249,7 +253,7 @@ describe('detect', () => {
249253
throw Error('Should not find a browser')
250254
})
251255
.catch((err) => {
252-
expect(err.notDetectedAtPath).to.be.true
256+
expect(err.notDetectedAtPath).toBe(true)
253257
})
254258
})
255259

0 commit comments

Comments
 (0)