From 36495bd5e0cf2ec25091658f1d0a203dea33c484 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Mon, 16 Nov 2020 13:28:08 +0100 Subject: [PATCH] fix(jest): update cache function for new Jest 27 API --- 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;