Skip to content

Commit d0a1f0f

Browse files
authored
chore: update jest to the latest version (#193)
* chore: update jest to the latest version * test: update snaps * chore: remove jest-worker * fix: lint
1 parent b7e09f9 commit d0a1f0f

12 files changed

+1098
-1178
lines changed

package-lock.json

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

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
},
6464
"dependencies": {
6565
"cssnano": "^5.1.8",
66-
"jest-worker": "^27.5.1",
66+
"jest-worker": "^29.0.3",
6767
"postcss": "^8.4.13",
6868
"schema-utils": "^4.0.0",
6969
"serialize-javascript": "^6.0.0",
@@ -80,7 +80,7 @@
8080
"@types/csso": "^5.0.0",
8181
"@types/serialize-javascript": "^5.0.2",
8282
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
83-
"babel-jest": "^28.1.0",
83+
"babel-jest": "^29.0.3",
8484
"clean-css": "^5.3.0",
8585
"copy-webpack-plugin": "^9.1.0",
8686
"cross-env": "^7.0.3",
@@ -94,7 +94,7 @@
9494
"eslint-config-prettier": "^8.5.0",
9595
"eslint-plugin-import": "^2.26.0",
9696
"husky": "^8.0.1",
97-
"jest": "^28.1.0",
97+
"jest": "^29.0.3",
9898
"lightningcss": "^1.14.0",
9999
"lint-staged": "^12.4.1",
100100
"memfs": "^3.4.1",

test/__snapshots__/CssMinimizerPlugin.test.js.snap

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

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

+40-40
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`"cache" option should work with the "false" value for the "cache" option: assets 1`] = `
4-
Object {
4+
{
55
"five.css": "body{color:red;font-size:20px}a{color:blue}",
66
"four.css": "h1{color:green}h2{color:#ff0}",
77
"one.css": "a{text-align:center}",
@@ -11,7 +11,7 @@ Object {
1111
`;
1212

1313
exports[`"cache" option should work with the "false" value for the "cache" option: assets 2`] = `
14-
Object {
14+
{
1515
"five.css": "body{color:red;font-size:20px}a{color:blue}",
1616
"four.css": "h1{color:green}h2{color:#ff0}",
1717
"one.css": "a{text-align:center}",
@@ -20,16 +20,16 @@ Object {
2020
}
2121
`;
2222

23-
exports[`"cache" option should work with the "false" value for the "cache" option: errors 1`] = `Array []`;
23+
exports[`"cache" option should work with the "false" value for the "cache" option: errors 1`] = `[]`;
2424

25-
exports[`"cache" option should work with the "false" value for the "cache" option: errors 2`] = `Array []`;
25+
exports[`"cache" option should work with the "false" value for the "cache" option: errors 2`] = `[]`;
2626

27-
exports[`"cache" option should work with the "false" value for the "cache" option: warnings 1`] = `Array []`;
27+
exports[`"cache" option should work with the "false" value for the "cache" option: warnings 1`] = `[]`;
2828

29-
exports[`"cache" option should work with the "false" value for the "cache" option: warnings 2`] = `Array []`;
29+
exports[`"cache" option should work with the "false" value for the "cache" option: warnings 2`] = `[]`;
3030

3131
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and output warnings: assets 1`] = `
32-
Object {
32+
{
3333
"five.css": "body {
3434
color: red;
3535
}
@@ -78,7 +78,7 @@ a {
7878
`;
7979

8080
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and output warnings: assets 2`] = `
81-
Object {
81+
{
8282
"five.css": "body {
8383
color: red;
8484
}
@@ -126,12 +126,12 @@ a {
126126
}
127127
`;
128128

129-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and output warnings: errors 1`] = `Array []`;
129+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and output warnings: errors 1`] = `[]`;
130130

131-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and output warnings: errors 2`] = `Array []`;
131+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and output warnings: errors 2`] = `[]`;
132132

133133
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and output warnings: warnings 1`] = `
134-
Array [
134+
[
135135
"Warning: five.css from Css Minimizer plugin
136136
[warning-plugin] Warning from five.css",
137137
"Warning: four.css from Css Minimizer plugin
@@ -146,7 +146,7 @@ Array [
146146
`;
147147

148148
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and output warnings: warnings 2`] = `
149-
Array [
149+
[
150150
"Warning: five.css from Css Minimizer plugin
151151
[warning-plugin] Warning from five.css",
152152
"Warning: four.css from Css Minimizer plugin
@@ -161,55 +161,55 @@ Array [
161161
`;
162162

163163
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: assets 1`] = `
164-
Object {
164+
{
165165
"five.css": "body{color:red;font-size:20px}a{color:blue}
166166
/*# sourceMappingURL=five.css.map*/",
167-
"five.css.map": "{\\"version\\":3,\\"file\\":\\"five.css\\",\\"mappings\\":\\"AAGA,KACE,SAAU,CACV,cACF,CACA,EACE,UACF\\",\\"sources\\":[\\"webpack:///./test/bar1.css\\"],\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\nbody {\\\\n color: red;\\\\n font-size: 20px;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
167+
"five.css.map": "{"version":3,"file":"five.css","mappings":"AAGA,KACE,SAAU,CACV,cACF,CACA,EACE,UACF","sources":["webpack:///./test/bar1.css"],"sourcesContent":["body {\\n color: red;\\n}\\nbody {\\n color: red;\\n font-size: 20px;\\n}\\na {\\n color: blue;\\n}\\n"],"names":[],"sourceRoot":""}",
168168
"four.css": "h1{color:green}h2{color:#ff0}
169169
/*# sourceMappingURL=four.css.map*/",
170-
"four.css.map": "{\\"version\\":3,\\"file\\":\\"four.css\\",\\"mappings\\":\\"AAAA,GACE,WACF,CACA,GACE,UACF\\",\\"sources\\":[\\"webpack:///./test/bar2.css\\"],\\"sourcesContent\\":[\\"h1 {\\\\n color: green;\\\\n}\\\\nh2 {\\\\n color: yellow;\\\\n}\\\\nh3 {\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
170+
"four.css.map": "{"version":3,"file":"four.css","mappings":"AAAA,GACE,WACF,CACA,GACE,UACF","sources":["webpack:///./test/bar2.css"],"sourcesContent":["h1 {\\n color: green;\\n}\\nh2 {\\n color: yellow;\\n}\\nh3 {\\n}\\n"],"names":[],"sourceRoot":""}",
171171
"one.css": "a{text-align:center}
172172
/*# sourceMappingURL=one.css.map*/",
173-
"one.css.map": "{\\"version\\":3,\\"file\\":\\"one.css\\",\\"mappings\\":\\"AAAA,EACE,iBACF\\",\\"sources\\":[\\"webpack:///./test/foo.css\\"],\\"sourcesContent\\":[\\"a {\\\\n text-align: center;\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
173+
"one.css.map": "{"version":3,"file":"one.css","mappings":"AAAA,EACE,iBACF","sources":["webpack:///./test/foo.css"],"sourcesContent":["a {\\n text-align: center;\\n}\\n"],"names":[],"sourceRoot":""}",
174174
"three.css": "body{color:red;font-size:20px}a{color:blue}
175175
/*# sourceMappingURL=three.css.map*/",
176-
"three.css.map": "{\\"version\\":3,\\"file\\":\\"three.css\\",\\"mappings\\":\\"AAGA,KACE,SAAU,CACV,cACF,CACA,EACE,UACF\\",\\"sources\\":[\\"webpack:///./test/bar1.css\\"],\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\nbody {\\\\n color: red;\\\\n font-size: 20px;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
176+
"three.css.map": "{"version":3,"file":"three.css","mappings":"AAGA,KACE,SAAU,CACV,cACF,CACA,EACE,UACF","sources":["webpack:///./test/bar1.css"],"sourcesContent":["body {\\n color: red;\\n}\\nbody {\\n color: red;\\n font-size: 20px;\\n}\\na {\\n color: blue;\\n}\\n"],"names":[],"sourceRoot":""}",
177177
"two.css": "a{text-align:center}
178178
/*# sourceMappingURL=two.css.map*/",
179-
"two.css.map": "{\\"version\\":3,\\"file\\":\\"two.css\\",\\"mappings\\":\\"AAAA,EACE,iBACF\\",\\"sources\\":[\\"webpack:///./test/foo.css\\"],\\"sourcesContent\\":[\\"a {\\\\n text-align: center;\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
179+
"two.css.map": "{"version":3,"file":"two.css","mappings":"AAAA,EACE,iBACF","sources":["webpack:///./test/foo.css"],"sourcesContent":["a {\\n text-align: center;\\n}\\n"],"names":[],"sourceRoot":""}",
180180
}
181181
`;
182182

183183
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: assets 2`] = `
184-
Object {
184+
{
185185
"five.css": "body{color:red;font-size:20px}a{color:blue}
186186
/*# sourceMappingURL=five.css.map*/",
187-
"five.css.map": "{\\"version\\":3,\\"file\\":\\"five.css\\",\\"mappings\\":\\"AAGA,KACE,SAAU,CACV,cACF,CACA,EACE,UACF\\",\\"sources\\":[\\"webpack:///./test/bar1.css\\"],\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\nbody {\\\\n color: red;\\\\n font-size: 20px;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
187+
"five.css.map": "{"version":3,"file":"five.css","mappings":"AAGA,KACE,SAAU,CACV,cACF,CACA,EACE,UACF","sources":["webpack:///./test/bar1.css"],"sourcesContent":["body {\\n color: red;\\n}\\nbody {\\n color: red;\\n font-size: 20px;\\n}\\na {\\n color: blue;\\n}\\n"],"names":[],"sourceRoot":""}",
188188
"four.css": "h1{color:green}h2{color:#ff0}
189189
/*# sourceMappingURL=four.css.map*/",
190-
"four.css.map": "{\\"version\\":3,\\"file\\":\\"four.css\\",\\"mappings\\":\\"AAAA,GACE,WACF,CACA,GACE,UACF\\",\\"sources\\":[\\"webpack:///./test/bar2.css\\"],\\"sourcesContent\\":[\\"h1 {\\\\n color: green;\\\\n}\\\\nh2 {\\\\n color: yellow;\\\\n}\\\\nh3 {\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
190+
"four.css.map": "{"version":3,"file":"four.css","mappings":"AAAA,GACE,WACF,CACA,GACE,UACF","sources":["webpack:///./test/bar2.css"],"sourcesContent":["h1 {\\n color: green;\\n}\\nh2 {\\n color: yellow;\\n}\\nh3 {\\n}\\n"],"names":[],"sourceRoot":""}",
191191
"one.css": "a{text-align:center}
192192
/*# sourceMappingURL=one.css.map*/",
193-
"one.css.map": "{\\"version\\":3,\\"file\\":\\"one.css\\",\\"mappings\\":\\"AAAA,EACE,iBACF\\",\\"sources\\":[\\"webpack:///./test/foo.css\\"],\\"sourcesContent\\":[\\"a {\\\\n text-align: center;\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
193+
"one.css.map": "{"version":3,"file":"one.css","mappings":"AAAA,EACE,iBACF","sources":["webpack:///./test/foo.css"],"sourcesContent":["a {\\n text-align: center;\\n}\\n"],"names":[],"sourceRoot":""}",
194194
"three.css": "body{color:red;font-size:20px}a{color:blue}
195195
/*# sourceMappingURL=three.css.map*/",
196-
"three.css.map": "{\\"version\\":3,\\"file\\":\\"three.css\\",\\"mappings\\":\\"AAGA,KACE,SAAU,CACV,cACF,CACA,EACE,UACF\\",\\"sources\\":[\\"webpack:///./test/bar1.css\\"],\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\nbody {\\\\n color: red;\\\\n font-size: 20px;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
196+
"three.css.map": "{"version":3,"file":"three.css","mappings":"AAGA,KACE,SAAU,CACV,cACF,CACA,EACE,UACF","sources":["webpack:///./test/bar1.css"],"sourcesContent":["body {\\n color: red;\\n}\\nbody {\\n color: red;\\n font-size: 20px;\\n}\\na {\\n color: blue;\\n}\\n"],"names":[],"sourceRoot":""}",
197197
"two.css": "a{text-align:center}
198198
/*# sourceMappingURL=two.css.map*/",
199-
"two.css.map": "{\\"version\\":3,\\"file\\":\\"two.css\\",\\"mappings\\":\\"AAAA,EACE,iBACF\\",\\"sources\\":[\\"webpack:///./test/foo.css\\"],\\"sourcesContent\\":[\\"a {\\\\n text-align: center;\\\\n}\\\\n\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}",
199+
"two.css.map": "{"version":3,"file":"two.css","mappings":"AAAA,EACE,iBACF","sources":["webpack:///./test/foo.css"],"sourcesContent":["a {\\n text-align: center;\\n}\\n"],"names":[],"sourceRoot":""}",
200200
}
201201
`;
202202

203-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: errors 1`] = `Array []`;
203+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: errors 1`] = `[]`;
204204

205-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: errors 2`] = `Array []`;
205+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: errors 2`] = `[]`;
206206

207-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: warnings 1`] = `Array []`;
207+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: warnings 1`] = `[]`;
208208

209-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: warnings 2`] = `Array []`;
209+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option and source maps: warnings 2`] = `[]`;
210210

211211
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: assets 1`] = `
212-
Object {
212+
{
213213
"five.css": "body{color:red;font-size:20px}a{color:blue}",
214214
"four.css": "h1{color:green}h2{color:#ff0}",
215215
"one.css": "a{text-align:center}",
@@ -219,7 +219,7 @@ Object {
219219
`;
220220

221221
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: assets 2`] = `
222-
Object {
222+
{
223223
"five.css": "body{color:red;font-size:20px}a{color:blue}",
224224
"four.css": "h1{color:green}h2{color:#ff0}",
225225
"one.css": "a{text-align:center}",
@@ -228,16 +228,16 @@ Object {
228228
}
229229
`;
230230

231-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: errors 1`] = `Array []`;
231+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: errors 1`] = `[]`;
232232

233-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: errors 2`] = `Array []`;
233+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: errors 2`] = `[]`;
234234

235-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: warnings 1`] = `Array []`;
235+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: warnings 1`] = `[]`;
236236

237-
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: warnings 2`] = `Array []`;
237+
exports[`"cache" option should work with the "filesystem" value for the "cache.type" option: warnings 2`] = `[]`;
238238

239239
exports[`"cache" option should work with the "memory" value for the "cache.type" option: assets 1`] = `
240-
Object {
240+
{
241241
"five.css": "body{color:red;font-size:20px}a{color:blue}",
242242
"four.css": "h1{color:green}h2{color:#ff0}",
243243
"one.css": "a{text-align:center}",
@@ -247,7 +247,7 @@ Object {
247247
`;
248248

249249
exports[`"cache" option should work with the "memory" value for the "cache.type" option: assets 2`] = `
250-
Object {
250+
{
251251
"five.css": "body{color:red;font-size:20px}a{color:blue}",
252252
"four.css": "h1{color:green}h2{color:#ff0}",
253253
"one.css": "a{text-align:center}",
@@ -256,10 +256,10 @@ Object {
256256
}
257257
`;
258258

259-
exports[`"cache" option should work with the "memory" value for the "cache.type" option: errors 1`] = `Array []`;
259+
exports[`"cache" option should work with the "memory" value for the "cache.type" option: errors 1`] = `[]`;
260260

261-
exports[`"cache" option should work with the "memory" value for the "cache.type" option: errors 2`] = `Array []`;
261+
exports[`"cache" option should work with the "memory" value for the "cache.type" option: errors 2`] = `[]`;
262262

263-
exports[`"cache" option should work with the "memory" value for the "cache.type" option: warnings 1`] = `Array []`;
263+
exports[`"cache" option should work with the "memory" value for the "cache.type" option: warnings 1`] = `[]`;
264264

265-
exports[`"cache" option should work with the "memory" value for the "cache.type" option: warnings 2`] = `Array []`;
265+
exports[`"cache" option should work with the "memory" value for the "cache.type" option: warnings 2`] = `[]`;

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`exclude option should match snapshot for a single RegExp value excluded1: assets 1`] = `
4-
Object {
4+
{
55
"entry.css": "body{color:red}a{color:blue}",
66
"excluded1.css": "a {
77
text-align: center;
@@ -12,12 +12,12 @@ Object {
1212
}
1313
`;
1414

15-
exports[`exclude option should match snapshot for a single RegExp value excluded1: errors 1`] = `Array []`;
15+
exports[`exclude option should match snapshot for a single RegExp value excluded1: errors 1`] = `[]`;
1616

17-
exports[`exclude option should match snapshot for a single RegExp value excluded1: warnings 1`] = `Array []`;
17+
exports[`exclude option should match snapshot for a single RegExp value excluded1: warnings 1`] = `[]`;
1818

1919
exports[`exclude option should match snapshot for a single String value excluded1: assets 1`] = `
20-
Object {
20+
{
2121
"entry.css": "body{color:red}a{color:blue}",
2222
"excluded1.css": "a {
2323
text-align: center;
@@ -28,12 +28,12 @@ Object {
2828
}
2929
`;
3030

31-
exports[`exclude option should match snapshot for a single String value excluded1: errors 1`] = `Array []`;
31+
exports[`exclude option should match snapshot for a single String value excluded1: errors 1`] = `[]`;
3232

33-
exports[`exclude option should match snapshot for a single String value excluded1: warnings 1`] = `Array []`;
33+
exports[`exclude option should match snapshot for a single String value excluded1: warnings 1`] = `[]`;
3434

3535
exports[`exclude option should match snapshot for multiple RegExp values excluded1 and excluded2: assets 1`] = `
36-
Object {
36+
{
3737
"entry.css": "body{color:red}a{color:blue}",
3838
"excluded1.css": "a {
3939
text-align: center;
@@ -55,12 +55,12 @@ a {
5555
}
5656
`;
5757

58-
exports[`exclude option should match snapshot for multiple RegExp values excluded1 and excluded2: errors 1`] = `Array []`;
58+
exports[`exclude option should match snapshot for multiple RegExp values excluded1 and excluded2: errors 1`] = `[]`;
5959

60-
exports[`exclude option should match snapshot for multiple RegExp values excluded1 and excluded2: warnings 1`] = `Array []`;
60+
exports[`exclude option should match snapshot for multiple RegExp values excluded1 and excluded2: warnings 1`] = `[]`;
6161

6262
exports[`exclude option should match snapshot for multiple String values excluded1 and excluded2: assets 1`] = `
63-
Object {
63+
{
6464
"entry.css": "body{color:red}a{color:blue}",
6565
"excluded1.css": "a {
6666
text-align: center;
@@ -82,6 +82,6 @@ a {
8282
}
8383
`;
8484

85-
exports[`exclude option should match snapshot for multiple String values excluded1 and excluded2: errors 1`] = `Array []`;
85+
exports[`exclude option should match snapshot for multiple String values excluded1 and excluded2: errors 1`] = `[]`;
8686

87-
exports[`exclude option should match snapshot for multiple String values excluded1 and excluded2: warnings 1`] = `Array []`;
87+
exports[`exclude option should match snapshot for multiple String values excluded1 and excluded2: warnings 1`] = `[]`;

0 commit comments

Comments
 (0)