From 0a96100777c67dbe3366801f1f44201980a81566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 1 Oct 2018 16:15:51 +0100 Subject: [PATCH] Use rootDir in the haste map cache name --- packages/jest-haste-map/src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/jest-haste-map/src/index.js b/packages/jest-haste-map/src/index.js index 2cfc28a093ad..a2708ca47fef 100644 --- a/packages/jest-haste-map/src/index.js +++ b/packages/jest-haste-map/src/index.js @@ -255,9 +255,10 @@ class HasteMap extends EventEmitter { 'deprecated. Provide a RegExp instead. See https://github.com/facebook/jest/pull/4063.', ); } + const rootDirHash = crypto.createHash('md5').update(options.rootDir); this._cachePath = HasteMap.getCacheFilePath( this._options.cacheDirectory, - `haste-map-${this._options.name}`, + `haste-map-${this._options.name}-${rootDirHash}`, VERSION, this._options.roots .map(root => fastPath.relative(options.rootDir, root))