Skip to content

Commit c677abf

Browse files
committed
fix
1 parent 2b65aae commit c677abf

File tree

8 files changed

+8
-223
lines changed

8 files changed

+8
-223
lines changed

crates/swc_fast_ts_strip/benches/assets.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ fn fast_ts(c: &mut Criterion) {
99
fn fast_typescript(b: &mut Bencher) {
1010
b.iter(|| {
1111
::testing::run_test(false, |cm, handler| {
12-
black_box(operate(
12+
let _result = black_box(operate(
1313
&cm,
1414
handler,
1515
black_box(SOURCE.to_string()),
1616
Options {
1717
..Default::default()
1818
},
19-
))
20-
.unwrap();
19+
));
2120

2221
Ok(())
2322
})

crates/swc_fast_ts_strip/tests/fixture.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ fn test(input: PathBuf) {
1616
let transform_output_file = input.with_extension("transform.js");
1717

1818
let err = testing::run_test(false, |cm, handler| {
19-
let code = operate(&cm, handler, input_code.clone(), opts(Mode::StripOnly))
20-
.expect("should not return Err()")
21-
.code;
19+
if let Ok(code) = operate(&cm, handler, input_code.clone(), opts(Mode::StripOnly)) {
20+
let code = code.code;
2221

23-
NormalizedOutput::new_raw(code)
24-
.compare_to_file(output_file)
25-
.unwrap();
22+
NormalizedOutput::new_raw(code)
23+
.compare_to_file(output_file)
24+
.unwrap();
25+
}
2626

2727
if handler.has_errors() {
2828
return Err(());

crates/swc_fast_ts_strip/tests/fixture/class-properties.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

crates/swc_fast_ts_strip/tests/fixture/class-properties.swc-stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
: ^^^^^^^^^^^^^^^^^^
66
4 | console.log(3)
77
`----
8-
help: Unsupported syntax

crates/swc_fast_ts_strip/tests/fixture/test-case-1.js

Lines changed: 0 additions & 198 deletions
This file was deleted.

crates/swc_fast_ts_strip/tests/fixture/test-case-1.swc-stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
: ^^^^^^^^^^^^^^
66
8 | //^^^^^^^^
77
`----
8-
help: Unsupported syntax

crates/swc_fast_ts_strip/tests/fixture/unicode.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

crates/swc_fast_ts_strip/tests/fixture/unicode.swc-stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
: ^^^^^^^^^^^^^^
66
5 | }
77
`----
8-
help: Unsupported syntax

0 commit comments

Comments
 (0)