Skip to content

Commit

Permalink
Add a test for swc-project#2627
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Mar 3, 2022
1 parent ce78344 commit 0fdc007
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
let a = 1;
const b = 1;
var c = 1;
}
console.log(a);
console.log(b);
console.log(c);
14 changes: 13 additions & 1 deletion crates/swc_ecma_transforms_compat/tests/es2015_block_scoping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use swc_ecma_transforms_compat::{
es2015::{block_scoping, for_of::for_of},
es2017::async_to_generator,
};
use swc_ecma_transforms_testing::{compare_stdout, test, test_exec, Tester};
use swc_ecma_transforms_testing::{compare_stdout, test, test_exec, test_fixture, Tester};

test!(
::swc_ecma_parser::Syntax::default(),
Expand Down Expand Up @@ -1021,3 +1021,15 @@ fn exec(input: PathBuf) {
&input,
);
}

#[testing::fixture("tests/block-scoping/**/input.js")]
fn fixture(input: PathBuf) {
let output = input.with_file_name("output.js");

test_fixture(
Default::default(),
&|_| chain!(resolver(), block_scoping()),
&input,
&output,
);
}

0 comments on commit 0fdc007

Please sign in to comment.