Skip to content

Commit fc3a43f

Browse files
committed
chore: make test work on windows
1 parent d1b2c74 commit fc3a43f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/__tests__/utils.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ jest.mock('cosmiconfig', () => {
1010

1111
jest.mock('cpy')
1212

13-
let whichSyncMock, readPkgUpSyncMock, cpy
13+
let whichSyncMock, readPkgUpSyncMock, cpy, nodePath
1414

1515
beforeEach(() => {
1616
jest.resetModules()
17+
nodePath = require('path')
1718
whichSyncMock = require('which').sync
1819
readPkgUpSyncMock = require('read-pkg-up').sync
1920
cpy = require('cpy')
@@ -175,7 +176,7 @@ test('should generate typescript definitions into provided folder', async () =>
175176

176177
expect(cpy).toHaveBeenCalledTimes(1)
177178
expect(cpy).toHaveBeenCalledWith('**/*.d.ts', '../dist', {
178-
cwd: '/blah/src',
179+
cwd: `${nodePath.sep}blah${nodePath.sep}src`,
179180
parents: true,
180181
})
181182
})

0 commit comments

Comments
 (0)