From 438aa46036b752cdf30ab56910b3677909931af7 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 26 Sep 2021 22:24:05 +0200 Subject: [PATCH] fix(jest): update cache function for new Jest 27 API (#408) --- packages/fbjs-scripts/jest/createCacheKeyFunction.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/fbjs-scripts/jest/createCacheKeyFunction.js b/packages/fbjs-scripts/jest/createCacheKeyFunction.js index 89091896..2e73413d 100644 --- a/packages/fbjs-scripts/jest/createCacheKeyFunction.js +++ b/packages/fbjs-scripts/jest/createCacheKeyFunction.js @@ -32,6 +32,8 @@ function getGlobalCacheKey(files, values) { function getCacheKeyFunction(globalCacheKey) { return (src, file, configString, options) => { + // Jest 27 passes a single options bag which contains `configString` rather than as a separate argument + options = options || configString; const {instrument, config} = options; const rootDir = config && config.rootDir;