Skip to content

chore: update jest to the latest version #457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,464 changes: 744 additions & 720 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^28.1.3",
"babel-jest": "^29.0.3",
"cross-env": "^7.0.3",
"del": "^6.1.1",
"del-cli": "^4.0.0",
Expand All @@ -63,7 +63,7 @@
"handlebars": "^4.7.7",
"html-webpack-plugin": "^5.3.2",
"husky": "^8.0.1",
"jest": "^28.1.3",
"jest": "^29.0.3",
"lint-staged": "^13.0.3",
"memfs": "^3.4.7",
"npm-run-all": "^4.1.5",
Expand Down
1,754 changes: 877 additions & 877 deletions test/__snapshots__/esModule-option.test.js.snap

Large diffs are not rendered by default.

788 changes: 394 additions & 394 deletions test/__snapshots__/loader.test.js.snap

Large diffs are not rendered by default.

2,016 changes: 1,008 additions & 1,008 deletions test/__snapshots__/minimize-option.test.js.snap

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions test/__snapshots__/preprocessor-option.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,91 +1,91 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`'process' option should work with Async "preprocessor" Function option: errors 1`] = `Array []`;
exports[`'process' option should work with Async "preprocessor" Function option: errors 1`] = `[]`;

exports[`'process' option should work with Async "preprocessor" Function option: module 1`] = `
"// Imports
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \\"../../src/runtime/getUrl.js\\";
var ___HTML_LOADER_IMPORT_0___ = new URL(\\"./image.png\\", import.meta.url);
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js";
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png", import.meta.url);
// Module
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);
var code = \\"<div>\\\\n <p>Alexander Krasnoyarov</p>\\\\n <img src=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_0___ + \\"\\\\\\" alt=\\\\\\"alt\\\\\\" />\\\\n<div>\\\\n\\";
var code = "<div>\\n <p>Alexander Krasnoyarov</p>\\n <img src=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\" alt=\\"alt\\" />\\n<div>\\n";
// Exports
export default code;"
`;

exports[`'process' option should work with Async "preprocessor" Function option: result 1`] = `
"<div>
<p>Alexander Krasnoyarov</p>
<img src=\\"replaced_file_protocol_/webpack/public/path/image.png\\" alt=\\"alt\\" />
<img src="replaced_file_protocol_/webpack/public/path/image.png" alt="alt" />
<div>
"
`;

exports[`'process' option should work with Async "preprocessor" Function option: warnings 1`] = `Array []`;
exports[`'process' option should work with Async "preprocessor" Function option: warnings 1`] = `[]`;

exports[`'process' option should work with the "preprocessor" option #2: errors 1`] = `Array []`;
exports[`'process' option should work with the "preprocessor" option #2: errors 1`] = `[]`;

exports[`'process' option should work with the "preprocessor" option #2: module 1`] = `
"// Imports
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \\"../../src/runtime/getUrl.js\\";
var ___HTML_LOADER_IMPORT_0___ = new URL(\\"./image.png.webp\\", import.meta.url);
var ___HTML_LOADER_IMPORT_1___ = new URL(\\"./image.png\\", import.meta.url);
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js";
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png.webp", import.meta.url);
var ___HTML_LOADER_IMPORT_1___ = new URL("./image.png", import.meta.url);
// Module
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);
var ___HTML_LOADER_REPLACEMENT_1___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_1___);
var code = \\"<picture><source type=\\\\\\"image/webp\\\\\\" srcset=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_0___ + \\"\\\\\\"><img src=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_1___ + \\"\\\\\\"></picture>\\\\n\\";
var code = "<picture><source type=\\"image/webp\\" srcset=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\"><img src=\\"" + ___HTML_LOADER_REPLACEMENT_1___ + "\\"></picture>\\n";
// Exports
export default code;"
`;

exports[`'process' option should work with the "preprocessor" option #2: result 1`] = `
"<picture><source type=\\"image/webp\\" srcset=\\"replaced_file_protocol_/webpack/public/path/image.png.webp\\"><img src=\\"replaced_file_protocol_/webpack/public/path/image.png\\"></picture>
"<picture><source type="image/webp" srcset="replaced_file_protocol_/webpack/public/path/image.png.webp"><img src="replaced_file_protocol_/webpack/public/path/image.png"></picture>
"
`;

exports[`'process' option should work with the "preprocessor" option #2: warnings 1`] = `Array []`;
exports[`'process' option should work with the "preprocessor" option #2: warnings 1`] = `[]`;

exports[`'process' option should work with the "preprocessor" option: errors 1`] = `Array []`;
exports[`'process' option should work with the "preprocessor" option: errors 1`] = `[]`;

exports[`'process' option should work with the "preprocessor" option: module 1`] = `
"// Imports
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \\"../../src/runtime/getUrl.js\\";
var ___HTML_LOADER_IMPORT_0___ = new URL(\\"./image.png\\", import.meta.url);
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js";
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png", import.meta.url);
// Module
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);
var code = \\"<div>\\\\n <p>Alexander Krasnoyarov</p>\\\\n <img src=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_0___ + \\"\\\\\\" alt=\\\\\\"alt\\\\\\" />\\\\n<div>\\\\n\\";
var code = "<div>\\n <p>Alexander Krasnoyarov</p>\\n <img src=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\" alt=\\"alt\\" />\\n<div>\\n";
// Exports
export default code;"
`;

exports[`'process' option should work with the "preprocessor" option: result 1`] = `
"<div>
<p>Alexander Krasnoyarov</p>
<img src=\\"replaced_file_protocol_/webpack/public/path/image.png\\" alt=\\"alt\\" />
<img src="replaced_file_protocol_/webpack/public/path/image.png" alt="alt" />
<div>
"
`;

exports[`'process' option should work with the "preprocessor" option: warnings 1`] = `Array []`;
exports[`'process' option should work with the "preprocessor" option: warnings 1`] = `[]`;

exports[`'process' option should work with the Async "preprocessor" Function option #2: errors 1`] = `Array []`;
exports[`'process' option should work with the Async "preprocessor" Function option #2: errors 1`] = `[]`;

exports[`'process' option should work with the Async "preprocessor" Function option #2: module 1`] = `
"// Imports
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \\"../../src/runtime/getUrl.js\\";
var ___HTML_LOADER_IMPORT_0___ = new URL(\\"./image.png.webp\\", import.meta.url);
var ___HTML_LOADER_IMPORT_1___ = new URL(\\"./image.png\\", import.meta.url);
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js";
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png.webp", import.meta.url);
var ___HTML_LOADER_IMPORT_1___ = new URL("./image.png", import.meta.url);
// Module
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);
var ___HTML_LOADER_REPLACEMENT_1___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_1___);
var code = \\"<picture><source type=\\\\\\"image/webp\\\\\\" srcset=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_0___ + \\"\\\\\\"><img src=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_1___ + \\"\\\\\\"></picture>\\\\n\\";
var code = "<picture><source type=\\"image/webp\\" srcset=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\"><img src=\\"" + ___HTML_LOADER_REPLACEMENT_1___ + "\\"></picture>\\n";
// Exports
export default code;"
`;

exports[`'process' option should work with the Async "preprocessor" Function option #2: result 1`] = `
"<picture><source type=\\"image/webp\\" srcset=\\"replaced_file_protocol_/webpack/public/path/image.png.webp\\"><img src=\\"replaced_file_protocol_/webpack/public/path/image.png\\"></picture>
"<picture><source type="image/webp" srcset="replaced_file_protocol_/webpack/public/path/image.png.webp"><img src="replaced_file_protocol_/webpack/public/path/image.png"></picture>
"
`;

exports[`'process' option should work with the Async "preprocessor" Function option #2: warnings 1`] = `Array []`;
exports[`'process' option should work with the Async "preprocessor" Function option #2: warnings 1`] = `[]`;
10,272 changes: 5,136 additions & 5,136 deletions test/__snapshots__/sources-option.test.js.snap

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/__snapshots__/validate-options.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports[`validate options should throw an error on the "sources" option with "{"
exports[`validate options should throw an error on the "sources" option with "{"list":[{"tag":"img","attribute":"src"}]}" value 1`] = `
"Invalid options object. HTML Loader has been initialized using an options object that does not match the API schema.
- options.sources.list[0] misses the property 'type'. Should be:
\\"src\\" | \\"srcset\\""
"src" | "srcset""
`;

exports[`validate options should throw an error on the "sources" option with "{"scriptingEnabled":"true"}" value 1`] = `
Expand Down
56 changes: 28 additions & 28 deletions test/runtime/__snapshots__/getUrl.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ image.png"

exports[`getUrl should work 9`] = `"image image.png"`;

exports[`getUrl should work 10`] = `"image\\"image.png"`;
exports[`getUrl should work 10`] = `"image"image.png"`;

exports[`getUrl should work 11`] = `"image'image.png"`;

Expand All @@ -38,63 +38,63 @@ exports[`getUrl should work 15`] = `"image\`image.png"`;

exports[`getUrl should work 16`] = `"image.png"`;

exports[`getUrl should work 17`] = `"\\"image image.png\\""`;
exports[`getUrl should work 17`] = `""image image.png""`;

exports[`getUrl should work 18`] = `
"\\"image
image.png\\""
""image
image.png""
`;

exports[`getUrl should work 19`] = `"\\"image image.png\\""`;
exports[`getUrl should work 19`] = `""image image.png""`;

exports[`getUrl should work 20`] = `
"\\"image
image.png\\""
""image
image.png""
`;

exports[`getUrl should work 21`] = `"\\"image image.png\\""`;
exports[`getUrl should work 21`] = `""image image.png""`;

exports[`getUrl should work 22`] = `"\\"image\\"image.png\\""`;
exports[`getUrl should work 22`] = `""image"image.png""`;

exports[`getUrl should work 23`] = `"\\"image'image.png\\""`;
exports[`getUrl should work 23`] = `""image'image.png""`;

exports[`getUrl should work 24`] = `"\\"image=image.png\\""`;
exports[`getUrl should work 24`] = `""image=image.png""`;

exports[`getUrl should work 25`] = `"\\"image>image.png\\""`;
exports[`getUrl should work 25`] = `""image>image.png""`;

exports[`getUrl should work 26`] = `"\\"image<image.png\\""`;
exports[`getUrl should work 26`] = `""image<image.png""`;

exports[`getUrl should work 27`] = `"\\"image\`image.png\\""`;
exports[`getUrl should work 27`] = `""image\`image.png""`;

exports[`getUrl should work 28`] = `"image.png#hash"`;

exports[`getUrl should work 29`] = `"\\"image image.png#hash\\""`;
exports[`getUrl should work 29`] = `""image image.png#hash""`;

exports[`getUrl should work 30`] = `
"\\"image
image.png#hash\\""
""image
image.png#hash""
`;

exports[`getUrl should work 31`] = `"\\"image image.png#hash\\""`;
exports[`getUrl should work 31`] = `""image image.png#hash""`;

exports[`getUrl should work 32`] = `
"\\"image
image.png#hash\\""
""image
image.png#hash""
`;

exports[`getUrl should work 33`] = `"\\"image image.png#hash\\""`;
exports[`getUrl should work 33`] = `""image image.png#hash""`;

exports[`getUrl should work 34`] = `"\\"image\\"image.png#hash\\""`;
exports[`getUrl should work 34`] = `""image"image.png#hash""`;

exports[`getUrl should work 35`] = `"\\"image'image.png#hash\\""`;
exports[`getUrl should work 35`] = `""image'image.png#hash""`;

exports[`getUrl should work 36`] = `"\\"image=image.png#hash\\""`;
exports[`getUrl should work 36`] = `""image=image.png#hash""`;

exports[`getUrl should work 37`] = `"\\"image>image.png#hash\\""`;
exports[`getUrl should work 37`] = `""image>image.png#hash""`;

exports[`getUrl should work 38`] = `"\\"image<image.png#hash\\""`;
exports[`getUrl should work 38`] = `""image<image.png#hash""`;

exports[`getUrl should work 39`] = `"\\"image\`image.png#hash\\""`;
exports[`getUrl should work 39`] = `""image\`image.png#hash""`;

exports[`getUrl should work 40`] = `"image.png#hash"`;

Expand All @@ -114,7 +114,7 @@ image.png#hash"

exports[`getUrl should work 45`] = `"image image.png#hash"`;

exports[`getUrl should work 46`] = `"image\\"image.png#hash"`;
exports[`getUrl should work 46`] = `"image"image.png#hash"`;

exports[`getUrl should work 47`] = `"image'image.png#hash"`;

Expand Down