Update Jest to 27.2.0 (#13776)

* Update Jest to `27.2.0`

* Update
This commit is contained in:
Nicolò Ribaudo 2021-09-17 19:02:36 +02:00 committed by GitHub
parent 422b87a76f
commit a815d7dd10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 409 additions and 385 deletions

View File

@ -59,8 +59,8 @@
"gulp-filter": "^5.1.0",
"gulp-plumber": "^1.2.1",
"husky": "^3.0.0",
"jest": "^27.0.0",
"jest-worker": "^27.0.2",
"jest": "^27.2.0",
"jest-worker": "^27.2.0",
"lint-staged": "^9.2.0",
"lodash": "^4.17.21",
"mergeiterator": "^1.2.5",

View File

@ -1,11 +1,31 @@
// Temporary workaround for https://github.com/facebook/jest/issues/9771
// Source: https://github.com/facebook/jest/issues/9771#issuecomment-841624042
const resolver = require("enhanced-resolve").create.sync({
conditionNames: ["node", "require", "default"],
extensions: [".js", ".json", ".node", ".ts"],
});
const enhancedResolve = require("enhanced-resolve");
const EXTENSIONS = [".js", ".json", ".node", ".ts"];
function mapGetOr(map, key, init) {
if (!map.has(key)) {
map.set(key, init());
}
return map.get(key);
}
const resolversCache = new Map();
function getResolver(conditionNames) {
const cacheKeySeparator = ":::";
const cacheKey = conditionNames.join(cacheKeySeparator);
return mapGetOr(resolversCache, cacheKey, () =>
enhancedResolve.create.sync({
conditionNames,
extensions: EXTENSIONS,
})
);
}
module.exports = function (request, options) {
const resolver = getResolver(options.conditions || ["default"]);
return resolver(options.basedir, request);
};

762
yarn.lock

File diff suppressed because it is too large Load Diff