mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 02:06:08 +03:00
29 lines
778 B
JavaScript
29 lines
778 B
JavaScript
const swc = require('../../../');
|
|
|
|
it('should work without parser.sytax', () => {
|
|
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();
|
|
}); |