mirror of https://github.com/webpack/webpack.git
chore(deps): update `jest`
This commit is contained in:
parent
120c655709
commit
378f6a47d7
|
@ -25,7 +25,7 @@ describe("Defaults", () => {
|
||||||
`${quotemeta(escapedCwd)}((?:\\\\\\\\)?(?:[a-zA-Z.\\-_]+\\\\\\\\)*)`,
|
`${quotemeta(escapedCwd)}((?:\\\\\\\\)?(?:[a-zA-Z.\\-_]+\\\\\\\\)*)`,
|
||||||
"g"
|
"g"
|
||||||
);
|
);
|
||||||
const normalize = str => {
|
const normalizeCwd = str => {
|
||||||
if (cwd.startsWith("/")) {
|
if (cwd.startsWith("/")) {
|
||||||
str = str.replace(new RegExp(quotemeta(cwd), "g"), "<cwd>");
|
str = str.replace(new RegExp(quotemeta(cwd), "g"), "<cwd>");
|
||||||
} else {
|
} else {
|
||||||
|
@ -35,12 +35,6 @@ describe("Defaults", () => {
|
||||||
(m, g) => `<cwd>${g.replace(/\\\\/g, "/")}`
|
(m, g) => `<cwd>${g.replace(/\\\\/g, "/")}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
str = str.replace(
|
|
||||||
/\/\[.+]node_modules\[.+]\//,
|
|
||||||
"/[\\\\\\/]node_modules[\\\\\\/]/i"
|
|
||||||
);
|
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,7 +49,7 @@ describe("Defaults", () => {
|
||||||
return value instanceof Diff;
|
return value instanceof Diff;
|
||||||
},
|
},
|
||||||
print(received) {
|
print(received) {
|
||||||
return normalize(received.value);
|
return normalizeCwd(received.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -64,16 +58,7 @@ describe("Defaults", () => {
|
||||||
return typeof value === "string";
|
return typeof value === "string";
|
||||||
},
|
},
|
||||||
print(received) {
|
print(received) {
|
||||||
return JSON.stringify(normalize(received));
|
return JSON.stringify(normalizeCwd(received));
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
expect.addSnapshotSerializer({
|
|
||||||
test(value) {
|
|
||||||
return value instanceof RegExp;
|
|
||||||
},
|
|
||||||
print(received) {
|
|
||||||
return received.toString();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -127,7 +112,7 @@ describe("Defaults", () => {
|
||||||
"type": "javascript/auto",
|
"type": "javascript/auto",
|
||||||
},
|
},
|
||||||
Object {
|
Object {
|
||||||
"test": /\\.json$/i,
|
"test": /\\\\\\.json\\$/i,
|
||||||
"type": "json",
|
"type": "json",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -145,7 +130,7 @@ describe("Defaults", () => {
|
||||||
"unsafeCache": false,
|
"unsafeCache": false,
|
||||||
"wrappedContextCritical": false,
|
"wrappedContextCritical": false,
|
||||||
"wrappedContextRecursive": true,
|
"wrappedContextRecursive": true,
|
||||||
"wrappedContextRegExp": /.*/,
|
"wrappedContextRegExp": /\\.\\*/,
|
||||||
},
|
},
|
||||||
"name": undefined,
|
"name": undefined,
|
||||||
"node": Object {
|
"node": Object {
|
||||||
|
@ -190,7 +175,7 @@ describe("Defaults", () => {
|
||||||
"idHint": "vendors",
|
"idHint": "vendors",
|
||||||
"priority": -10,
|
"priority": -10,
|
||||||
"reuseExistingChunk": true,
|
"reuseExistingChunk": true,
|
||||||
"test": /[\\\\\\/]node_modules[\\\\\\/]/i,
|
"test": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/i,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"chunks": "async",
|
"chunks": "async",
|
||||||
|
@ -820,7 +805,7 @@ describe("Defaults", () => {
|
||||||
- "idHint": "vendors",
|
- "idHint": "vendors",
|
||||||
- "priority": -10,
|
- "priority": -10,
|
||||||
- "reuseExistingChunk": true,
|
- "reuseExistingChunk": true,
|
||||||
- "test": /[\\\\\\/]node_modules[\\\\\\/]/ii,
|
- "test": /[\\\\/]node_modules[\\\\/]/i,
|
||||||
- },
|
- },
|
||||||
- },
|
- },
|
||||||
- "chunks": "async",
|
- "chunks": "async",
|
||||||
|
|
Loading…
Reference in New Issue