swc/node-swc/__tests__/transform/issue834_test.js
2022-04-11 18:45:58 +00:00

30 lines
780 B
JavaScript

const swc = require('../../../');
it('should work without parser.syntax', () => {
const out = swc.transformSync(`const someValue = "test" ?? "default value";`, {
jsc: {
parser: {
nullishCoalescing: true,
numericSeparator: true
},
}
}
);
expect(out.map).toBeFalsy();
});
it('should work with parser.syntax', () => {
const out = swc.transformSync(`const someValue = "test" ?? "default value";`, {
jsc: {
parser: {
syntax: 'ecmascript',
nullishCoalescing: true,
numericSeparator: true
},
}
}
);
expect(out.map).toBeFalsy();
});