We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df634de commit 2409720Copy full SHA for 2409720
crates/rspack_plugin_rstest/src/parser_plugin.rs
@@ -568,6 +568,14 @@ impl RstestParserPlugin {
568
prop: &swc_core::ecma::ast::IdentName,
569
statement_span: Option<Span>,
570
) -> Option<bool> {
571
+ // Check if this is a global variable (free variable) or an ESM import
572
+ let is_global = !parser.is_variable_defined(&ident.sym);
573
+
574
+ // Skip global variables if globals option is disabled
575
+ if is_global && !self.globals {
576
+ return None;
577
+ }
578
579
match (ident.sym.as_str(), prop.sym.as_str()) {
580
// rs.mock
581
("rs" | "rstest", "mock") => {
0 commit comments