test(oxc_transformer): define works differently with esbuild (#7593)

See https://github.com/oxc-project/oxc/issues/7594

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
翠 / green 2024-12-03 16:23:40 +09:00 committed by GitHub
parent 16adaf9afd
commit 71b3437a4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,6 +59,18 @@ fn dot() {
test("process['env'].NODE_ENV", "production", config.clone());
}
#[ignore]
#[test]
fn dot_with_overlap() {
let config = ReplaceGlobalDefinesConfig::new(&[
("import.meta.env.FOO", "import.meta.env.FOO"),
("import.meta.env", "__foo__"),
])
.unwrap();
test("import.meta.env", "__foo__", config.clone());
test("import.meta.env.NODE_ENV", "import.meta.env.NODE_ENV", config.clone());
}
#[test]
fn dot_nested() {
let config = ReplaceGlobalDefinesConfig::new(&[("process", "production")]).unwrap();