diff --git a/napi/transform/test/transform.test.ts b/napi/transform/test/transform.test.ts index faad8be0d9a2e..fa7aeaecd2909 100644 --- a/napi/transform/test/transform.test.ts +++ b/napi/transform/test/transform.test.ts @@ -2,7 +2,7 @@ import { assert, describe, it } from 'vitest'; import oxc from './index'; -describe('transform', () => { +describe('simple', () => { const code = 'export class A {}'; 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 = `