mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
A test harness for checking results of semantic analysis. I got tired of writing ad-hoc test cases when finding bugs in semantic analysis, so I made this.
33 lines
644 B
Rust
33 lines
644 B
Rust
mod util;
|
|
|
|
#[allow(clippy::wildcard_imports)]
|
|
use util::*;
|
|
|
|
#[test]
|
|
fn test_exports() {
|
|
let test = SemanticTester::js(
|
|
"
|
|
function foo(a, b) {
|
|
let c = a + b;
|
|
return c / 2
|
|
}
|
|
|
|
export class ExportModifier {
|
|
constructor(x) {
|
|
this.x = x;
|
|
}
|
|
}
|
|
|
|
const defaultExport = 1;
|
|
|
|
export { foo };
|
|
export default defaultExport;
|
|
",
|
|
)
|
|
.with_module_record_builder(true);
|
|
|
|
test.has_some_symbol("foo").is_exported().test();
|
|
|
|
// FIXME: failing
|
|
// test.has_some_symbol("defaultExport").is_exported().test();
|
|
}
|