Skip to content

Commit bec3e3e

Browse files
authoredMar 17, 2025··
test(es/minifier): Test only sizes for large inputs (#10208)
**Description:** Large output results do not help catch errors
1 parent e71b000 commit bec3e3e

30 files changed

+268
-205183
lines changed
 

‎.github/workflows/CI.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ jobs:
301301
- name: Run cargo test (swc_ecma_minifier)
302302
if: matrix.settings.crate == 'swc_ecma_minifier'
303303
run: |
304-
cargo test -p swc_ecma_minifier --features concurrent
304+
cargo test -p swc_ecma_minifier --features concurrent --release
305305
306306
- name: Run cargo test (swc_ecma_parser)
307307
if: matrix.settings.crate == 'swc_ecma_parser'

‎Cargo.lock

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

‎Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ resolver = "2"
129129
wasmer = { version = "=5.0.5-rc1", default-features = false }
130130
wasmer-wasix = { version = "0.35.0", default-features = false }
131131
wide = "0.7.32"
132+
humansize = "2.1.3"
132133

133134
[profile.release]
134135
lto = true

‎crates/swc_ecma_minifier/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ trace-ast = []
3535
[dependencies]
3636
arrayvec = { workspace = true }
3737
backtrace = { workspace = true, optional = true }
38+
flate2 = { workspace = true }
39+
humansize = { workspace = true }
3840
indexmap = { workspace = true }
3941
num-bigint = { workspace = true }
4042
num_cpus = { workspace = true }

‎crates/swc_ecma_minifier/scripts/size.sh

-9
This file was deleted.

‎crates/swc_ecma_minifier/scripts/test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export SWC_RUN=0
88

99
touch tests/compress.rs
1010

11+
UPDATE=1 cargo test -p swc_ecma_minifier --release --test size
1112
cargo test -p swc_ecma_minifier -p swc --no-fail-fast --test projects --test tsc --test compress --test mangle --features concurrent $@
1213

1314
# find ../swc/tests/ -type f -empty -delete

‎crates/swc_ecma_minifier/tests/benches-full/d3.js

-11,297
This file was deleted.

‎crates/swc_ecma_minifier/tests/benches-full/echarts.js

-48,795
This file was deleted.

‎crates/swc_ecma_minifier/tests/benches-full/jquery.js

-4,506
This file was deleted.

‎crates/swc_ecma_minifier/tests/benches-full/lodash.js

-10,924
This file was deleted.

‎crates/swc_ecma_minifier/tests/benches-full/moment.js

-2,149
This file was deleted.

‎crates/swc_ecma_minifier/tests/benches-full/react.js

-1,121
This file was deleted.

‎crates/swc_ecma_minifier/tests/benches-full/terser.js

-20,481
This file was deleted.

‎crates/swc_ecma_minifier/tests/benches-full/three.js

-16,580
This file was deleted.

‎crates/swc_ecma_minifier/tests/benches-full/victory.js

-34,884
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.