Skip to content

Commit 7dd065c

Browse files
authored
chore: update jest to the latest version (#457)
* chore: update jest to the latest version * test: update snaps
1 parent 3ddf326 commit 7dd065c

9 files changed

+8216
-8192
lines changed

package-lock.json

+744-720
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@commitlint/cli": "^17.1.2",
5353
"@commitlint/config-conventional": "^17.1.0",
5454
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
55-
"babel-jest": "^28.1.3",
55+
"babel-jest": "^29.0.3",
5656
"cross-env": "^7.0.3",
5757
"del": "^6.1.1",
5858
"del-cli": "^4.0.0",
@@ -63,7 +63,7 @@
6363
"handlebars": "^4.7.7",
6464
"html-webpack-plugin": "^5.3.2",
6565
"husky": "^8.0.1",
66-
"jest": "^28.1.3",
66+
"jest": "^29.0.3",
6767
"lint-staged": "^13.0.3",
6868
"memfs": "^3.4.7",
6969
"npm-run-all": "^4.1.5",

test/__snapshots__/esModule-option.test.js.snap

+877-877
Large diffs are not rendered by default.

test/__snapshots__/loader.test.js.snap

+394-394
Large diffs are not rendered by default.

test/__snapshots__/minimize-option.test.js.snap

+1,008-1,008
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

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

55
exports[`'process' option should work with Async "preprocessor" Function option: module 1`] = `
66
"// Imports
7-
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \\"../../src/runtime/getUrl.js\\";
8-
var ___HTML_LOADER_IMPORT_0___ = new URL(\\"./image.png\\", import.meta.url);
7+
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js";
8+
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png", import.meta.url);
99
// Module
1010
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);
11-
var code = \\"<div>\\\\n <p>Alexander Krasnoyarov</p>\\\\n <img src=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_0___ + \\"\\\\\\" alt=\\\\\\"alt\\\\\\" />\\\\n<div>\\\\n\\";
11+
var code = "<div>\\n <p>Alexander Krasnoyarov</p>\\n <img src=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\" alt=\\"alt\\" />\\n<div>\\n";
1212
// Exports
1313
export default code;"
1414
`;
1515
1616
exports[`'process' option should work with Async "preprocessor" Function option: result 1`] = `
1717
"<div>
1818
<p>Alexander Krasnoyarov</p>
19-
<img src=\\"replaced_file_protocol_/webpack/public/path/image.png\\" alt=\\"alt\\" />
19+
<img src="replaced_file_protocol_/webpack/public/path/image.png" alt="alt" />
2020
<div>
2121
"
2222
`;
2323
24-
exports[`'process' option should work with Async "preprocessor" Function option: warnings 1`] = `Array []`;
24+
exports[`'process' option should work with Async "preprocessor" Function option: warnings 1`] = `[]`;
2525
26-
exports[`'process' option should work with the "preprocessor" option #2: errors 1`] = `Array []`;
26+
exports[`'process' option should work with the "preprocessor" option #2: errors 1`] = `[]`;
2727
2828
exports[`'process' option should work with the "preprocessor" option #2: module 1`] = `
2929
"// Imports
30-
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \\"../../src/runtime/getUrl.js\\";
31-
var ___HTML_LOADER_IMPORT_0___ = new URL(\\"./image.png.webp\\", import.meta.url);
32-
var ___HTML_LOADER_IMPORT_1___ = new URL(\\"./image.png\\", import.meta.url);
30+
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js";
31+
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png.webp", import.meta.url);
32+
var ___HTML_LOADER_IMPORT_1___ = new URL("./image.png", import.meta.url);
3333
// Module
3434
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);
3535
var ___HTML_LOADER_REPLACEMENT_1___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_1___);
36-
var code = \\"<picture><source type=\\\\\\"image/webp\\\\\\" srcset=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_0___ + \\"\\\\\\"><img src=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_1___ + \\"\\\\\\"></picture>\\\\n\\";
36+
var code = "<picture><source type=\\"image/webp\\" srcset=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\"><img src=\\"" + ___HTML_LOADER_REPLACEMENT_1___ + "\\"></picture>\\n";
3737
// Exports
3838
export default code;"
3939
`;
4040
4141
exports[`'process' option should work with the "preprocessor" option #2: result 1`] = `
42-
"<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>
42+
"<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>
4343
"
4444
`;
4545
46-
exports[`'process' option should work with the "preprocessor" option #2: warnings 1`] = `Array []`;
46+
exports[`'process' option should work with the "preprocessor" option #2: warnings 1`] = `[]`;
4747
48-
exports[`'process' option should work with the "preprocessor" option: errors 1`] = `Array []`;
48+
exports[`'process' option should work with the "preprocessor" option: errors 1`] = `[]`;
4949
5050
exports[`'process' option should work with the "preprocessor" option: module 1`] = `
5151
"// Imports
52-
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \\"../../src/runtime/getUrl.js\\";
53-
var ___HTML_LOADER_IMPORT_0___ = new URL(\\"./image.png\\", import.meta.url);
52+
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js";
53+
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png", import.meta.url);
5454
// Module
5555
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);
56-
var code = \\"<div>\\\\n <p>Alexander Krasnoyarov</p>\\\\n <img src=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_0___ + \\"\\\\\\" alt=\\\\\\"alt\\\\\\" />\\\\n<div>\\\\n\\";
56+
var code = "<div>\\n <p>Alexander Krasnoyarov</p>\\n <img src=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\" alt=\\"alt\\" />\\n<div>\\n";
5757
// Exports
5858
export default code;"
5959
`;
6060
6161
exports[`'process' option should work with the "preprocessor" option: result 1`] = `
6262
"<div>
6363
<p>Alexander Krasnoyarov</p>
64-
<img src=\\"replaced_file_protocol_/webpack/public/path/image.png\\" alt=\\"alt\\" />
64+
<img src="replaced_file_protocol_/webpack/public/path/image.png" alt="alt" />
6565
<div>
6666
"
6767
`;
6868
69-
exports[`'process' option should work with the "preprocessor" option: warnings 1`] = `Array []`;
69+
exports[`'process' option should work with the "preprocessor" option: warnings 1`] = `[]`;
7070
71-
exports[`'process' option should work with the Async "preprocessor" Function option #2: errors 1`] = `Array []`;
71+
exports[`'process' option should work with the Async "preprocessor" Function option #2: errors 1`] = `[]`;
7272
7373
exports[`'process' option should work with the Async "preprocessor" Function option #2: module 1`] = `
7474
"// Imports
75-
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from \\"../../src/runtime/getUrl.js\\";
76-
var ___HTML_LOADER_IMPORT_0___ = new URL(\\"./image.png.webp\\", import.meta.url);
77-
var ___HTML_LOADER_IMPORT_1___ = new URL(\\"./image.png\\", import.meta.url);
75+
import ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___ from "../../src/runtime/getUrl.js";
76+
var ___HTML_LOADER_IMPORT_0___ = new URL("./image.png.webp", import.meta.url);
77+
var ___HTML_LOADER_IMPORT_1___ = new URL("./image.png", import.meta.url);
7878
// Module
7979
var ___HTML_LOADER_REPLACEMENT_0___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_0___);
8080
var ___HTML_LOADER_REPLACEMENT_1___ = ___HTML_LOADER_GET_SOURCE_FROM_IMPORT___(___HTML_LOADER_IMPORT_1___);
81-
var code = \\"<picture><source type=\\\\\\"image/webp\\\\\\" srcset=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_0___ + \\"\\\\\\"><img src=\\\\\\"\\" + ___HTML_LOADER_REPLACEMENT_1___ + \\"\\\\\\"></picture>\\\\n\\";
81+
var code = "<picture><source type=\\"image/webp\\" srcset=\\"" + ___HTML_LOADER_REPLACEMENT_0___ + "\\"><img src=\\"" + ___HTML_LOADER_REPLACEMENT_1___ + "\\"></picture>\\n";
8282
// Exports
8383
export default code;"
8484
`;
8585
8686
exports[`'process' option should work with the Async "preprocessor" Function option #2: result 1`] = `
87-
"<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>
87+
"<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>
8888
"
8989
`;
9090
91-
exports[`'process' option should work with the Async "preprocessor" Function option #2: warnings 1`] = `Array []`;
91+
exports[`'process' option should work with the Async "preprocessor" Function option #2: warnings 1`] = `[]`;

test/__snapshots__/sources-option.test.js.snap

+5,136-5,136
Large diffs are not rendered by default.

test/__snapshots__/validate-options.test.js.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ exports[`validate options should throw an error on the "sources" option with "{"
6161
exports[`validate options should throw an error on the "sources" option with "{"list":[{"tag":"img","attribute":"src"}]}" value 1`] = `
6262
"Invalid options object. HTML Loader has been initialized using an options object that does not match the API schema.
6363
- options.sources.list[0] misses the property 'type'. Should be:
64-
\\"src\\" | \\"srcset\\""
64+
"src" | "srcset""
6565
`;
6666
6767
exports[`validate options should throw an error on the "sources" option with "{"scriptingEnabled":"true"}" value 1`] = `

test/runtime/__snapshots__/getUrl.test.js.snap

+28-28
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ image.png"
2424

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

27-
exports[`getUrl should work 10`] = `"image\\"image.png"`;
27+
exports[`getUrl should work 10`] = `"image"image.png"`;
2828

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

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

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

41-
exports[`getUrl should work 17`] = `"\\"image image.png\\""`;
41+
exports[`getUrl should work 17`] = `""image image.png""`;
4242

4343
exports[`getUrl should work 18`] = `
44-
"\\"image
45-
image.png\\""
44+
""image
45+
image.png""
4646
`;
4747

48-
exports[`getUrl should work 19`] = `"\\"imageimage.png\\""`;
48+
exports[`getUrl should work 19`] = `""imageimage.png""`;
4949

5050
exports[`getUrl should work 20`] = `
51-
"\\"image
52-
image.png\\""
51+
""image
52+
image.png""
5353
`;
5454

55-
exports[`getUrl should work 21`] = `"\\"image image.png\\""`;
55+
exports[`getUrl should work 21`] = `""image image.png""`;
5656

57-
exports[`getUrl should work 22`] = `"\\"image\\"image.png\\""`;
57+
exports[`getUrl should work 22`] = `""image"image.png""`;
5858

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

61-
exports[`getUrl should work 24`] = `"\\"image=image.png\\""`;
61+
exports[`getUrl should work 24`] = `""image=image.png""`;
6262

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

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

67-
exports[`getUrl should work 27`] = `"\\"image\`image.png\\""`;
67+
exports[`getUrl should work 27`] = `""image\`image.png""`;
6868

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

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

7373
exports[`getUrl should work 30`] = `
74-
"\\"image
75-
image.png#hash\\""
74+
""image
75+
image.png#hash""
7676
`;
7777

78-
exports[`getUrl should work 31`] = `"\\"imageimage.png#hash\\""`;
78+
exports[`getUrl should work 31`] = `""imageimage.png#hash""`;
7979

8080
exports[`getUrl should work 32`] = `
81-
"\\"image
82-
image.png#hash\\""
81+
""image
82+
image.png#hash""
8383
`;
8484

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

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

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

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)