Skip to content

Commit

Permalink
Use relative paths in haste map (#7020)
Browse files Browse the repository at this point in the history
* Used relative paths in haste map
* Update changelog
* Use relative roots for the name of the cached haste map
* Improved performance of path manipulations
* Use rootDir in the haste map cache name
  • Loading branch information
rubennorte authored Oct 2, 2018
1 parent f0f2ee3 commit 659b048
Show file tree
Hide file tree
Showing 19 changed files with 604 additions and 353 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

- `[jest-each]` Add each array validation check ([#7033](https://github.com/facebook/jest/pull/7033))
- `[jest-haste-map]` [**BREAKING**] Replace internal data structures to improve performance ([#6960](https://github.com/facebook/jest/pull/6960))
- `[jest-haste-map]` Use relative paths to allow remote caching ([#7020](https://github.com/facebook/jest/pull/7020))
- `[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))
Expand Down
1 change: 1 addition & 0 deletions e2e/__tests__/haste_map_sha1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ test('exits the process after test are done but before timers complete', async (
name: 'tmp',
platforms: ['ios', 'android'],
retainAllFiles: true,
rootDir: DIR,
roots: [DIR],
useWatchman: false,
watch: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
exports[`HasteMap file system changes processing recovery from duplicate module IDs recovers when the most recent duplicate is fixed 1`] = `
"The name \`Pear\` was looked up in the Haste module map. It cannot be resolved, because there exists several different files, or packages, that provide a module for that particular name and platform. The platform is generic (no extension). You must delete or blacklist files until there remains only one of these:
* \`/fruits/blueberry.js\` (module)
* \`/fruits/pear.js\` (module)
* \`/project/fruits/blueberry.js\` (module)
* \`/project/fruits/pear.js\` (module)
"
`;

exports[`HasteMap file system changes processing recovery from duplicate module IDs recovers when the oldest version of the duplicates is fixed 1`] = `
"The name \`Pear\` was looked up in the Haste module map. It cannot be resolved, because there exists several different files, or packages, that provide a module for that particular name and platform. The platform is generic (no extension). You must delete or blacklist files until there remains only one of these:
* \`/fruits/blueberry.js\` (module)
* \`/fruits/pear.js\` (module)
* \`/project/fruits/blueberry.js\` (module)
* \`/project/fruits/pear.js\` (module)
"
`;

exports[`HasteMap throws on duplicate module ids if "throwOnModuleCollision" is set to true 1`] = `
[Error: jest-haste-map: @providesModule naming collision:
Duplicate module name: Strawberry
Paths: /fruits/raspberry.js collides with /fruits/strawberry.js
Paths: /project/fruits/raspberry.js collides with /project/fruits/strawberry.js
This error is caused by a @providesModule declaration with the same name across two different files.]
`;
Expand All @@ -33,21 +33,21 @@ exports[`HasteMap tries to crawl using node as a fallback 1`] = `
exports[`HasteMap warns on duplicate mock files 1`] = `
"jest-haste-map: duplicate manual mock found:
Module name: subdir/blueberry
Duplicate Mock path: /fruits2/__mocks__/subdir/blueberry.js
Duplicate Mock path: /project/fruits2/__mocks__/subdir/blueberry.js
This warning is caused by two manual mock files with the same file name.
Jest will use the mock file found in:
/fruits2/__mocks__/subdir/blueberry.js
/project/fruits2/__mocks__/subdir/blueberry.js
Please delete one of the following two files:
/fruits1/__mocks__/subdir/blueberry.js
/fruits2/__mocks__/subdir/blueberry.js
/project/fruits1/__mocks__/subdir/blueberry.js
/project/fruits2/__mocks__/subdir/blueberry.js
"
`;

exports[`HasteMap warns on duplicate module ids 1`] = `
"jest-haste-map: @providesModule naming collision:
Duplicate module name: Strawberry
Paths: /fruits/raspberry.js collides with /fruits/strawberry.js
Paths: /project/fruits/raspberry.js collides with /project/fruits/strawberry.js
This warning is caused by a @providesModule declaration with the same name across two different files."
`;
Loading

0 comments on commit 659b048

Please sign in to comment.