From d683089be1116f7944fcd3dbd4536b343becdf5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 29 Jan 2024 19:25:42 +0900 Subject: [PATCH] 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 --- crates/swc_ecma_transforms_testing/src/lib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/swc_ecma_transforms_testing/src/lib.rs b/crates/swc_ecma_transforms_testing/src/lib.rs index 22cb61ef9d6..4a719baefcc 100644 --- a/crates/swc_ecma_transforms_testing/src/lib.rs +++ b/crates/swc_ecma_transforms_testing/src/lib.rs @@ -361,12 +361,10 @@ where { let _logger = testing::init(); - let expected = read_to_string(output); - let _is_really_expected = expected.is_ok(); - let expected = expected.unwrap_or_default(); + let expected = output; let expected_src = Tester::run(|tester| { - let expected_module = tester.apply_transform(noop(), "expected.js", syntax, &expected)?; + let expected_module = tester.apply_transform(noop(), "expected.js", syntax, expected)?; let expected_src = tester.print(&expected_module, &Default::default()); @@ -411,8 +409,8 @@ where Ok(actual_src) }) - .1 - .to_string(); + .0 + .unwrap(); assert_eq!( expected_src, actual_src,