Skip to content

Commit

Permalink
Add a test, really
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Oct 11, 2023
1 parent 613a8e4 commit d9e76a3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use swc_ecma_transforms_compat::{
es2022::class_properties,
es3::reserved_words,
};
use swc_ecma_transforms_testing::{compare_stdout, test, test_exec, Tester};
use swc_ecma_transforms_testing::{compare_stdout, test, test_exec, test_fixture, Tester};
use swc_ecma_visit::Fold;

fn syntax() -> Syntax {
Expand Down Expand Up @@ -6656,6 +6656,25 @@ fn exec(input: PathBuf) {
);
}

#[testing::fixture("tests/class-properties/**/input.js")]
fn fixture(input: PathBuf) {
test_fixture(
Default::default(),
&|t| {
let unresolved_mark = Mark::new();
let top_level_mark = Mark::new();

chain!(
resolver(unresolved_mark, top_level_mark, false),
class_properties(Some(t.comments.clone()), Default::default())
)
},
&input,
&input.with_file_name("output.js"),
Default::default(),
);
}

test!(
syntax(),
|t| class_properties(Some(t.comments.clone()), Default::default()),
Expand Down

0 comments on commit d9e76a3

Please sign in to comment.