chore(deps): update `jest`

This commit is contained in:
evilebottnawi 2020-02-25 18:55:01 +03:00
parent 120c655709
commit 378f6a47d7
1 changed files with 7 additions and 22 deletions

View File

@ -25,7 +25,7 @@ describe("Defaults", () => {
`${quotemeta(escapedCwd)}((?:\\\\\\\\)?(?:[a-zA-Z.\\-_]+\\\\\\\\)*)`,
"g"
);
const normalize = str => {
const normalizeCwd = str => {
if (cwd.startsWith("/")) {
str = str.replace(new RegExp(quotemeta(cwd), "g"), "<cwd>");
} else {
@ -35,12 +35,6 @@ describe("Defaults", () => {
(m, g) => `<cwd>${g.replace(/\\\\/g, "/")}`
);
}
str = str.replace(
/\/\[.+]node_modules\[.+]\//,
"/[\\\\\\/]node_modules[\\\\\\/]/i"
);
return str;
};
@ -55,7 +49,7 @@ describe("Defaults", () => {
return value instanceof Diff;
},
print(received) {
return normalize(received.value);
return normalizeCwd(received.value);
}
});
@ -64,16 +58,7 @@ describe("Defaults", () => {
return typeof value === "string";
},
print(received) {
return JSON.stringify(normalize(received));
}
});
expect.addSnapshotSerializer({
test(value) {
return value instanceof RegExp;
},
print(received) {
return received.toString();
return JSON.stringify(normalizeCwd(received));
}
});
@ -127,7 +112,7 @@ describe("Defaults", () => {
"type": "javascript/auto",
},
Object {
"test": /\\.json$/i,
"test": /\\\\\\.json\\$/i,
"type": "json",
},
],
@ -145,7 +130,7 @@ describe("Defaults", () => {
"unsafeCache": false,
"wrappedContextCritical": false,
"wrappedContextRecursive": true,
"wrappedContextRegExp": /.*/,
"wrappedContextRegExp": /\\.\\*/,
},
"name": undefined,
"node": Object {
@ -190,7 +175,7 @@ describe("Defaults", () => {
"idHint": "vendors",
"priority": -10,
"reuseExistingChunk": true,
"test": /[\\\\\\/]node_modules[\\\\\\/]/i,
"test": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/i,
},
},
"chunks": "async",
@ -820,7 +805,7 @@ describe("Defaults", () => {
- "idHint": "vendors",
- "priority": -10,
- "reuseExistingChunk": true,
- "test": /[\\\\\\/]node_modules[\\\\\\/]/ii,
- "test": /[\\\\/]node_modules[\\\\/]/i,
- },
- },
- "chunks": "async",