Skip to content

Commit d683089

Browse files
authoredJan 29, 2024
fix(es/testing): Make test_inline! not read output as a file (#8569)
**Description:** I made a mistake while working on `test_inline!` **Related issue:** - #8568
1 parent fd7cf4c commit d683089

File tree

1 file changed

+4
-6
lines changed
  • crates/swc_ecma_transforms_testing/src

1 file changed

+4
-6
lines changed
 

‎crates/swc_ecma_transforms_testing/src/lib.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,10 @@ where
361361
{
362362
let _logger = testing::init();
363363

364-
let expected = read_to_string(output);
365-
let _is_really_expected = expected.is_ok();
366-
let expected = expected.unwrap_or_default();
364+
let expected = output;
367365

368366
let expected_src = Tester::run(|tester| {
369-
let expected_module = tester.apply_transform(noop(), "expected.js", syntax, &expected)?;
367+
let expected_module = tester.apply_transform(noop(), "expected.js", syntax, expected)?;
370368

371369
let expected_src = tester.print(&expected_module, &Default::default());
372370

@@ -411,8 +409,8 @@ where
411409

412410
Ok(actual_src)
413411
})
414-
.1
415-
.to_string();
412+
.0
413+
.unwrap();
416414

417415
assert_eq!(
418416
expected_src, actual_src,

0 commit comments

Comments
 (0)
Please sign in to comment.