Skip to content

Commit

Permalink
fix(jest-haste-map): Fixed Haste whitelist generation for scoped modu…
Browse files Browse the repository at this point in the history
…les on Windows (#6980)
  • Loading branch information
empyrical authored and SimenB committed Sep 17, 2018
1 parent 628a3d1 commit fb20ddd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- `[jest-haste-map]` [**BREAKING**] Replace internal data structures to improve performance ([#6960](https://github.com/facebook/jest/pull/6960))
- `[jest-haste-map]` Do not visit again files with the same sha-1 ([#6990](https://github.com/facebook/jest/pull/6990))
- `[jest-jasmine2]` Fix memory leak in Error objects hold by the framework ([#6965](https://github.com/facebook/jest/pull/6965))
- `[jest-haste-map]` Fixed Haste whitelist generation for scoped modules on Windows ([#6980](https://github.com/facebook/jest/pull/6980))

### Chore & Maintenance

Expand Down
5 changes: 4 additions & 1 deletion packages/jest-haste-map/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ const escapePathSeparator = string =>

const getWhiteList = (list: ?Array<string>): ?RegExp => {
if (list && list.length) {
const newList = list.map(item =>
escapePathSeparator(item.replace(/(\/)/g, path.sep)),
);
return new RegExp(
'(' +
escapePathSeparator(NODE_MODULES) +
'(?:' +
list.join('|') +
newList.join('|') +
')(?=$|' +
escapePathSeparator(path.sep) +
'))',
Expand Down

0 comments on commit fb20ddd

Please sign in to comment.