Skip to content

Commit

Permalink
Update Vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jan 8, 2025
1 parent 7b56b53 commit 9abec8d
Show file tree
Hide file tree
Showing 5 changed files with 765 additions and 846 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"@size-limit/webpack": "workspace:^",
"@size-limit/webpack-css": "workspace:^",
"@size-limit/webpack-why": "workspace:^",
"@vitest/coverage-v8": "^2.1.1",
"@vitest/coverage-v8": "^2.1.8",
"clean-publish": "^5.1.0",
"cross-spawn": "^7.0.6",
"eslint": "^9.17.0",
"print-snapshots": "^0.4.2",
"redux": "^4.2.1",
"size-limit-node-esbuild": "^0.3.0",
"vitest": "^2.1.1"
"vitest": "^2.1.8"
},
"prettier": {
"arrowParens": "avoid",
Expand Down
174 changes: 87 additions & 87 deletions packages/size-limit/test/__snapshots__/create-reporter.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@

exports[`highlight passed results with --highlight-less flag 1`] = `
"
[1mok[22m
Size limit: [32m[1m102.4 kB[22m[39m
Size: [32m[1m102.4 kB[22m[39m [90mbrotlied[39m
ok
Size limit: 102.4 kB
Size: 102.4 kB brotlied
[1mgood[22m
Size limit: [32m[1m102.4 kB[22m[39m
Size: [32m[1m97.28 kB[22m[39m [90mbrotlied[39m
good
Size limit: 102.4 kB
Size: 97.28 kB brotlied
[1mfail[22m
[31mPackage size limit has exceeded by 1 B[39m
Size limit: [31m[1m102400 B[22m[39m
Size: [31m[1m102401 B[22m[39m [90mbrotlied[39m
fail
Package size limit has exceeded by 1 B
Size limit: 102400 B
Size: 102401 B brotlied
[33mTry to reduce size or increase limit in [1m"size-limit"[22m section of [1mpackage.json[22m[39m
Try to reduce size or increase limit in "size-limit" section of package.json
"
`;

exports[`only renders failed results with --hide-passed flag 1`] = `
"
[1msmall fail[22m
[31mPackage size limit has exceeded by 1 B[39m
Size limit: [31m[1m102400 B[22m[39m
Size: [31m[1m102401 B[22m[39m [90mbrotlied[39m
small fail
Package size limit has exceeded by 1 B
Size limit: 102400 B
Size: 102401 B brotlied
[1mbig fail[22m
[31mPackage size limit has exceeded by 100 B[39m
Size limit: [31m[1m102.4 kB[22m[39m
Size: [31m[1m102.5 kB[22m[39m [90mbrotlied[39m
big fail
Package size limit has exceeded by 100 B
Size limit: 102.4 kB
Size: 102.5 kB brotlied
[33mTry to reduce size or increase limit in [1m"size-limit"[22m section of [1mpackage.json[22m[39m
Try to reduce size or increase limit in "size-limit" section of package.json
"
`;

Expand Down Expand Up @@ -60,74 +60,74 @@ exports[`renders Webpack stats help message 1`] = `

exports[`renders config-less result 1`] = `
"
[31mTotal time limit has exceeded[39m
Time limit: [31m[1m500 ms[22m[39m
Size: [31m[1m1 kB[22m[39m
Loading time: [31m[1m200 ms[22m[39m [90mon slow 3G[39m
Running time: [31m[1m300 ms[22m[39m [90mon Snapdragon 410[39m
Total time: [31m[1m500 ms[22m[39m
[33mTry to reduce size or increase limit[39m
Total time limit has exceeded
Time limit: 500 ms
Size: 1 kB
Loading time: 200 ms on slow 3G
Running time: 300 ms on Snapdragon 410
Total time: 500 ms
Try to reduce size or increase limit
"
`;

exports[`renders custom message 1`] = `
"
[31mPackage size limit has exceeded by 1 B[39m
Package size limit has exceeded by 1 B
see docs for additional instructions
Size limit: [31m[1m100 B[22m[39m
Size: [31m[1m101 B[22m[39m [90mbrotlied[39m
Size limit: 100 B
Size: 101 B brotlied
[33mTry to reduce size or increase limit at [1m.size-limit.json[22m[39m
Try to reduce size or increase limit at .size-limit.json
"
`;

exports[`renders failed results 1`] = `
"
[1mok[22m
Size limit: [32m[1m102.4 kB[22m[39m
Size: [32m[1m102.4 kB[22m[39m [90mbrotlied[39m
ok
Size limit: 102.4 kB
Size: 102.4 kB brotlied
[1msmall fail[22m
[31mPackage size limit has exceeded by 1 B[39m
Size limit: [31m[1m102400 B[22m[39m
Size: [31m[1m102401 B[22m[39m [90mbrotlied[39m
small fail
Package size limit has exceeded by 1 B
Size limit: 102400 B
Size: 102401 B brotlied
[1mbig fail[22m
[31mPackage size limit has exceeded by 100 B[39m
Size limit: [31m[1m102.4 kB[22m[39m
Size: [31m[1m102.5 kB[22m[39m [90mbrotlied[39m
big fail
Package size limit has exceeded by 100 B
Size limit: 102.4 kB
Size: 102.5 kB brotlied
[33mTry to reduce size or increase limit in [1m"size-limit"[22m section of [1mpackage.json[22m[39m
Try to reduce size or increase limit in "size-limit" section of package.json
"
`;

exports[`renders list of failed and success checks in silent mode 1`] = `
"
[1msmall fail[22m
[31mPackage size limit has exceeded by 1 B[39m
Size limit: [31m[1m102400 B[22m[39m
Size: [31m[1m102401 B[22m[39m [90mwith all dependencies, minified and brotlied[39m
small fail
Package size limit has exceeded by 1 B
Size limit: 102400 B
Size: 102401 B with all dependencies, minified and brotlied
[1mbig fail[22m
[31mPackage size limit has exceeded by 100 B[39m
Size limit: [31m[1m102.4 kB[22m[39m
Size: [31m[1m102.5 kB[22m[39m [90mwith all dependencies, minified and brotlied[39m
big fail
Package size limit has exceeded by 100 B
Size limit: 102.4 kB
Size: 102.5 kB with all dependencies, minified and brotlied
"
`;

exports[`renders list of failed checks in silent mode 1`] = `
"
[1msmall fail[22m
[31mPackage size limit has exceeded by 1 B[39m
Size limit: [31m[1m102400 B[22m[39m
Size: [31m[1m102401 B[22m[39m [90mwith all dependencies, minified and brotlied[39m
small fail
Package size limit has exceeded by 1 B
Size limit: 102400 B
Size: 102401 B with all dependencies, minified and brotlied
[1mbig fail[22m
[31mPackage size limit has exceeded by 100 B[39m
Size limit: [31m[1m102.4 kB[22m[39m
Size: [31m[1m102.5 kB[22m[39m [90mwith all dependencies, minified and brotlied[39m
big fail
Package size limit has exceeded by 100 B
Size limit: 102.4 kB
Size: 102.5 kB with all dependencies, minified and brotlied
"
`;
Expand All @@ -139,51 +139,51 @@ exports[`renders list of success checks in silent mode 1`] = `

exports[`renders result for file with gzip 1`] = `
"
Size limit: [32m[1m99 B[22m[39m
Size: [32m[1m100 B[22m[39m [90mgzipped[39m
Size limit: 99 B
Size: 100 B gzipped
"
`;

exports[`renders result for file without compression 1`] = `
"
Size limit: [32m[1m99 B[22m[39m
Size: [32m[1m100 B[22m[39m
Size limit: 99 B
Size: 100 B
"
`;

exports[`renders results 1`] = `
"
[1mlimitless[22m
Size: [1m10 B [22m [90mwith given webpack configuration[39m
Loading time: [1m100 ms[22m [90mon slow 3G[39m
Running time: [1m500 ms[22m [90mon Snapdragon 410[39m
Total time: [1m600 ms[22m
[1msize[22m
Size limit: [32m[1m102.4 kB[22m[39m
Size: [32m[1m102.4 kB[22m[39m [90mwith all dependencies, minified and brotlied[39m
Loading time: [32m[1m1 s [22m[39m [90mon slow 3G[39m
Running time: [32m[1m2 s [22m[39m [90mon Snapdragon 410[39m
Total time: [32m[1m3 s[22m[39m
[1mtime[22m
Time limit: [32m[1m4 s[22m[39m
Size: [32m[1m102.4 kB[22m[39m [90mwith all dependencies, minified and brotlied[39m
Loading time: [32m[1m1 s [22m[39m [90mon slow 3G[39m
Running time: [32m[1m2 s [22m[39m [90mon Snapdragon 410[39m
Total time: [32m[1m3 s[22m[39m
limitless
Size: 10 B with given webpack configuration
Loading time: 100 ms on slow 3G
Running time: 500 ms on Snapdragon 410
Total time: 600 ms
size
Size limit: 102.4 kB
Size: 102.4 kB with all dependencies, minified and brotlied
Loading time: 1 s on slow 3G
Running time: 2 s on Snapdragon 410
Total time: 3 s
time
Time limit: 4 s
Size: 102.4 kB with all dependencies, minified and brotlied
Loading time: 1 s on slow 3G
Running time: 2 s on Snapdragon 410
Total time: 3 s
"
`;

exports[`renders single result 1`] = `
"
[31mPackage size limit has exceeded by 1 B[39m
Size limit: [31m[1m100 B[22m[39m
Size: [31m[1m101 B[22m[39m [90mbrotlied[39m
Package size limit has exceeded by 1 B
Size limit: 100 B
Size: 101 B brotlied
[33mTry to reduce size or increase limit at [1m.size-limit.json[22m[39m
Try to reduce size or increase limit at .size-limit.json
"
`;
Loading

0 comments on commit 9abec8d

Please sign in to comment.