mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 04:32:01 +03:00
c78baef2cc
swc_ecma_transforms_compat: - Handle `new.target`. (#1179)
17 lines
623 B
Rust
17 lines
623 B
Rust
use std::{fs::read_to_string, path::PathBuf};
|
|
use swc_ecma_transforms_compat::es2015::new_target::new_target;
|
|
use swc_ecma_transforms_testing::{exec_tr, test_fixture};
|
|
|
|
#[testing::fixture("tests/fixture/new-target/**/exec.js")]
|
|
fn exec(input: PathBuf) {
|
|
let input = read_to_string(&input).unwrap();
|
|
exec_tr("new-target", Default::default(), |_| new_target(), &input);
|
|
}
|
|
|
|
#[testing::fixture("tests/fixture/new-target/**/input.js")]
|
|
fn fixture(input: PathBuf) {
|
|
let dir = input.parent().unwrap();
|
|
let output = dir.join("output.js");
|
|
test_fixture(Default::default(), &|_| new_target(), &input, &output);
|
|
}
|