Skip to content

Commit 353b37c

Browse files
committed
for windows snapshot compatibility, mock the sep before the tests
1 parent d88ac78 commit 353b37c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/jest-cli/src/lib/__tests__/init.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,18 @@ const resolveFromFixture = relativePath =>
2424
path.resolve(__dirname, 'fixtures', relativePath);
2525

2626
const writeFileSync = fs.writeFileSync;
27+
const sep = path.sep;
2728

2829
describe('init', () => {
2930
beforeEach(() => {
3031
fs.writeFileSync = jest.fn();
32+
path.sep = '/';
3133
});
3234

3335
afterEach(() => {
3436
jest.clearAllMocks();
3537
fs.writeFileSync = writeFileSync;
38+
path.sep = sep;
3639
});
3740

3841
describe('project with package.json and no jest config', () => {

0 commit comments

Comments
 (0)