FAIL packages/createApp.test.ts
● Test suite failed to run
× Expression expected
╭─[/workspaces/app/createApp.test.ts:11:1]
11 │ it('Создание и запуск приложения', async () => {
13 │
14 │ @Module({
· ─
15 │ providers: [
16 │ {
17 │ provide: 'level-3',
╰────
Caused by:
Syntax Error
at Compiler.transformSync (node_modules/@swc/core/index.js:241:29)
at transformSync (node_modules/@swc/core/index.js:348:21)
at transformJest (node_modules/@swc-node/core/index.ts:74:2)
at Object.process (node_modules/@swc-node/jest/index.ts:33:27)
at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:519:31)
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:648:40)
at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:700:19)
// before transform
{
module: 'commonjs',
sourcemap: 'inline',
experimentalDecorators: true,
emitDecoratorMetadata: false,
esModuleInterop: true,
swc: {
filename: '/workspaces/app/createApp.test.ts',
inputSourceMap: undefined,
sourceRoot: undefined,
jsc: {
externalHelpers: true,
parser: [Object],
paths: {},
keepClassNames: true,
target: 'es2015',
transform: [Object]
}
}
}
// after transform
{
filename: '/workspaces/app/createApp.test.ts',
jsc: {
externalHelpers: true,
parser: { syntax: 'typescript', tsx: true, dynamicImport: true },
paths: {},
keepClassNames: true,
target: 'es2015',
transform: { react: [Object] }
},
minify: false,
isModule: true,
module: { type: 'commonjs', noInterop: false },
sourceMaps: 'inline',
inlineSourcesContent: true,
swcrc: false,
inputSourceMap: undefined,
sourceRoot: undefined
}
Either use deepMerge to merge all of the options or use another way to provide defaults from tsconfig file
After upgrading from
1.5.5to1.6.2I get next error related to legacyDecorators:The source problem of the issue:
@swc-node/jestoptions to swc options@swc-node/jestoptionsswcproperty it overrides the wholejscsetup in the first piece of code.The log of the input options and result options are following:
Possible solution
Either use deepMerge to merge all of the options or use another way to provide defaults from tsconfig file