oxc/crates/oxc_semantic/tests/classes.rs
2023-12-25 23:59:35 +08:00

26 lines
460 B
Rust

mod util;
use util::SemanticTester;
#[test]
fn test_class_simple() {
SemanticTester::js(
"
class Foo {
#privateProperty = 1;
publicProperty = 2;
constructor() {} // this method is skip
a() {}
set b(v) {}
get b() {}
}
",
)
.has_class("Foo")
.has_number_of_methods(3)
.has_number_of_properties(2)
.has_method("a")
.has_property("privateProperty");
}