Skip to content

Commit

Permalink
Add computeSha1 option (#7345)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubennorte authored Nov 9, 2018
1 parent af33d14 commit 2c18a53
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- `[jest-util]` Add `jest.getTimerCount()` to get the count of scheduled fake timers ([#7285](https://github.com/facebook/jest/pull/7285))
- `[jest-config]` Add `dependencyExtractor` option to use a custom module to extract dependencies from files ([#7313](https://github.com/facebook/jest/pull/7313))
- `[jest-haste-map]` [**BREAKING**] Expose relative paths when getting the file iterator ([#7321](https://github.com/facebook/jest/pull/7321))
- `[jest-config]` Add `haste.computeSha1` option to compute the sha-1 of the files in the haste map ([#7345](https://github.com/facebook/jest/pull/7345))

### Fixes

Expand Down
1 change: 1 addition & 0 deletions e2e/__tests__/__snapshots__/show_config.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exports[`--showConfig outputs config info and exits 1`] = `
\\"forceCoverageMatch\\": [],
\\"globals\\": {},
\\"haste\\": {
\\"computeSha1\\": false,
\\"providesModuleNodeModules\\": []
},
\\"moduleDirectories\\": [
Expand Down
1 change: 1 addition & 0 deletions packages/jest-config/src/Defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default ({
globalTeardown: null,
globals: {},
haste: {
computeSha1: false,
providesModuleNodeModules: [],
},
moduleDirectories: ['node_modules'],
Expand Down
1 change: 1 addition & 0 deletions packages/jest-config/src/ValidConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default ({
globalTeardown: 'teardown.js',
globals: {__DEV__: true},
haste: {
computeSha1: true,
defaultPlatform: 'ios',
hasteImplModulePath: '<rootDir>/haste_impl.js',
platforms: ['ios', 'android'],
Expand Down
1 change: 1 addition & 0 deletions packages/jest-runtime/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class Runtime {

return new HasteMap({
cacheDirectory: config.cacheDirectory,
computeSha1: config.haste.computeSha1,
console: options && options.console,
dependencyExtractor: config.dependencyExtractor,
extensions: [Snapshot.EXTENSION].concat(config.moduleFileExtensions),
Expand Down
1 change: 1 addition & 0 deletions types/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type Path = string;
export type Glob = string;

export type HasteConfig = {|
computeSha1?: boolean,
defaultPlatform?: ?string,
hasteImplModulePath?: string,
platforms?: Array<string>,
Expand Down

0 comments on commit 2c18a53

Please sign in to comment.