Skip to content

Commit

Permalink
Fix mocking for modules with folders on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
KELiON committed Aug 10, 2017
1 parent e16ce6b commit 6749126
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/jest-haste-map/src/get_mock_name.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const MOCKS_PATTERN = path.sep + '__mocks__' + path.sep;

const getMockName = (filePath: string) => {
const mockPath = filePath.split(MOCKS_PATTERN)[1];
return mockPath.substring(0, mockPath.lastIndexOf(path.extname(mockPath)));
return mockPath.substring(0, mockPath.lastIndexOf(path.extname(mockPath))).replace(/\\/g, '/');
};

module.exports = getMockName;

0 comments on commit 6749126

Please sign in to comment.