Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Oct 2, 2024
1 parent 8768929 commit 3500789
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions napi/transform/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,27 @@ test(

// Test define plugin
// TODO: should be constant folded
test(oxc.transform('test.ts', 'if (process.env.NODE_ENV === "production") { foo; }', {
define: {
'process.env.NODE_ENV': 'false'
}
}), {
code: 'if (false === "production") {\n\tfoo;\n}\n',
});
test(
oxc.transform('test.ts', 'if (process.env.NODE_ENV === "production") { foo; }', {
define: {
'process.env.NODE_ENV': 'false',
},
}),
{
code: 'if (false === "production") {\n\tfoo;\n}\n',
},
);

// Test inject plugin
test(oxc.transform('test.ts', 'let _ = Object.assign', {
inject: {
'Object.assign': 'foo'
}
}), {
code: 'import $inject_Object_assign from "foo";\nlet _ = $inject_Object_assign;\n',
});
test(
oxc.transform('test.ts', 'let _ = Object.assign', {
inject: {
'Object.assign': 'foo',
},
}),
{
code: 'import $inject_Object_assign from "foo";\nlet _ = $inject_Object_assign;\n',
},
);

console.log('Success.');

0 comments on commit 3500789

Please sign in to comment.