mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
test(napi/transform): add test for not default es transform
This commit is contained in:
parent
eea4ab830a
commit
be819dded1
1 changed files with 20 additions and 1 deletions
|
|
@ -2,7 +2,7 @@ import { assert, describe, it } from 'vitest';
|
|||
|
||||
import oxc from './index';
|
||||
|
||||
describe('transform', () => {
|
||||
describe('simple', () => {
|
||||
const code = 'export class A<T> {}';
|
||||
|
||||
it('matches output', () => {
|
||||
|
|
@ -31,6 +31,25 @@ describe('transform', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('transform', () => {
|
||||
it('should not transform by default', () => {
|
||||
const cases = [
|
||||
'() => {};',
|
||||
'a ** b;',
|
||||
'async function foo() {}',
|
||||
'({ ...x });',
|
||||
'try {} catch {}',
|
||||
'a ?? b;',
|
||||
'a ||= b;',
|
||||
'class foo {\n\tstatic {}\n}',
|
||||
];
|
||||
for (const code of cases) {
|
||||
const ret = oxc.transform('test.ts', code);
|
||||
assert.equal(ret.code.trim(), code);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('modules', () => {
|
||||
it('should transform export = and import ', () => {
|
||||
const code = `
|
||||
|
|
|
|||
Loading…
Reference in a new issue