Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Sep 28, 2022
1 parent e00158a commit 6d75115
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions crates/swc_estree_compat/tests/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use serde_json::{Number, Value};
use swc::{config::IsModule, Compiler};
use swc_common::{
errors::{ColorConfig, Handler},
FileName, FilePathMapping, SourceMap,
FileName, FilePathMapping, SourceMap, GLOBALS,
};
use swc_ecma_parser::{EsConfig, Syntax};
use swc_estree_compat::babelify::{Babelify, Context};
Expand Down Expand Up @@ -76,19 +76,21 @@ fn fixtures() -> Result<(), Error> {
ignore_message: Default::default(),
},
testfn: DynTestFn(Box::alloc().init(move || {
let syntax = if is_typescript {
Syntax::Typescript(Default::default())
} else if is_jsx {
Syntax::Es(EsConfig {
jsx: true,
..Default::default()
})
} else {
Syntax::Es(EsConfig {
..Default::default()
})
};
run_test(input, output, syntax, is_module);
GLOBALS.set(&Default::default(), || {
let syntax = if is_typescript {
Syntax::Typescript(Default::default())
} else if is_jsx {
Syntax::Es(EsConfig {
jsx: true,
..Default::default()
})
} else {
Syntax::Es(EsConfig {
..Default::default()
})
};
run_test(input, output, syntax, is_module);
})
})),
})
}
Expand Down

0 comments on commit 6d75115

Please sign in to comment.