From ea9d969d095bb8259068f2bb93ca33425a82ab8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 8 Nov 2018 17:54:50 +0000 Subject: [PATCH] Add computeSha1 option --- CHANGELOG.md | 1 + packages/jest-config/src/Defaults.js | 1 + packages/jest-config/src/ValidConfig.js | 1 + packages/jest-runtime/src/index.js | 1 + types/Config.js | 1 + 5 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1df683e1edfd..1fe9ed2b5020 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/packages/jest-config/src/Defaults.js b/packages/jest-config/src/Defaults.js index ea40b3cf4e05..85b29b28f577 100644 --- a/packages/jest-config/src/Defaults.js +++ b/packages/jest-config/src/Defaults.js @@ -41,6 +41,7 @@ export default ({ globalTeardown: null, globals: {}, haste: { + computeSha1: false, providesModuleNodeModules: [], }, moduleDirectories: ['node_modules'], diff --git a/packages/jest-config/src/ValidConfig.js b/packages/jest-config/src/ValidConfig.js index 2d2d4128bc48..c3da446f08a5 100644 --- a/packages/jest-config/src/ValidConfig.js +++ b/packages/jest-config/src/ValidConfig.js @@ -51,6 +51,7 @@ export default ({ globalTeardown: 'teardown.js', globals: {__DEV__: true}, haste: { + computeSha1: true, defaultPlatform: 'ios', hasteImplModulePath: '/haste_impl.js', platforms: ['ios', 'android'], diff --git a/packages/jest-runtime/src/index.js b/packages/jest-runtime/src/index.js index f60b33b0dae6..f91e481a2925 100644 --- a/packages/jest-runtime/src/index.js +++ b/packages/jest-runtime/src/index.js @@ -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), diff --git a/types/Config.js b/types/Config.js index 957cb3afeaab..39eac782b764 100644 --- a/types/Config.js +++ b/types/Config.js @@ -11,6 +11,7 @@ export type Path = string; export type Glob = string; export type HasteConfig = {| + computeSha1?: boolean, defaultPlatform?: ?string, hasteImplModulePath?: string, platforms?: Array,