Skip to content

Commit

Permalink
Workaround to fix failing virtual mocks on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jennyEckstein committed Nov 15, 2021
1 parent 9a35936 commit b4cc5d8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,20 @@ describe('lib/index', () => {
() => ({ dependencies: { suji: '^1.0.0' }, devDependencies: { ju: '^1.0.0' } }),
{ virtual: true }
);
jest.mock(
`dir6\\package.json`,
() => ({ dependencies: { suji: '^1.0.0' }, devDependencies: { ju: '^1.0.0' } }),
{ virtual: true }
);
jest.mock('dir6/node_modules/suji/package.json', () => ({ version: '1.0.0' }), {
virtual: true
});
jest.mock('dir6/node_modules/ju/package.json', () => ({ version: '1.0.0' }), {
virtual: true
});
jest.mock('dir6\\node_modules\\ju\\package.json', () => ({ version: '1.0.0' }), {
virtual: true
});
mockExecAsync
.mockImplementationOnce(() => Promise.resolve({ stdout: JSON.stringify(['1.0.0', '1.0.1']) }))
.mockImplementationOnce(() => Promise.resolve({ stdout: JSON.stringify(['1.0.0', '1.0.1']) }))
Expand Down

0 comments on commit b4cc5d8

Please sign in to comment.