tsConfig.json
{
"extends": "./.temp/tsconfig-base.json"
}
tsconfig-base.json
{
"include": ["../src/**/*", "../types/**/*.d.ts", "./loader-types.d.ts", "./client-types.d.ts"],
"exclude": ["../src/**/*.spec.ts", "../src/**/*.spec.js"],
"compilerOptions": {
"strict": true,
"skipLibCheck": true,
"module": "esnext",
"target": "es6",
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"lib": ["dom", "es6", "dom.iterable", "scripthost"],
"noEmitHelpers": true,
"importHelpers": true,
"inlineSources": true,
"sourceMap": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"baseUrl": ".",
"paths": {
"~ngAppModule": ["./ng-app-module"]
},
"outDir": "../dist/",
"rootDir": "../src"
}
}
When I tried debugging this issue, it logs
{"extends":"./.temp/tsconfig-base.json","compilerOptions":{}} at https://github.com/vuejs/vue-jest/blob/master/lib/compilers/typescript-compiler.js#L11
related to #118
I can confirm this issue as well. I have been attempting to implement testing in Nuxt leveraging Jest. The default recommended config for nuxt-ts is:
{
"extends": "./node_modules/nuxt-ts/tsconfig.nuxt-ts.json"
}
Eventually I chased it down to a failure to load the extended attributes into the referenced object as previously mentioned by @yohodopo
can confirm this is happening aswell :(
i was trying to debug why my typescript decorator is having it's 3rd argument as undefined in the test but has value in app code.
NOTE The Property Descriptor will be undefined if your script target is less than ES5.
I assumed it was in vue-jest because it was trying to test a .vue file with lang="ts"
I tried tweaking the tsConfig option for vue-jest and finally managed to reproduce it if i didn't extend my config.. which is where my target option lies
From what I read, vue-jest v3 uses a very old package to resolve tsconfig.json, needed before TypeScript exposed config resolution features.
This package doesn't support configuration inheritance. A PR has been started, but never finished and merged.
I found this bug while making Quasar framework work nicely with TS and Jest, in which a esModuleInterop property from a preset configuration wasn't being picked up in the extending configuration, while everything worked fine when adding the property directly on the former.
Anyway, seems like the new V4 will support ts-jest which should manage inheritance correctly (it used native TS configuration management), so I guess the problem will be solved in some time.
Cya!
I am using "@vue/cli-service": "4.5.8", and still experience this issue.
To test I:
tsconfig.json (without extends), ran my test suite, and they passedtsconfig.json to tsconfig.base.json and created tsconfig.json with contents:{
"extends": "./tsconfig.base.json"
}
Most helpful comment
From what I read,
vue-jestv3 uses a very old package to resolvetsconfig.json, needed before TypeScript exposed config resolution features.This package doesn't support configuration inheritance. A PR has been started, but never finished and merged.
I found this bug while making Quasar framework work nicely with TS and Jest, in which a
esModuleInteropproperty from a preset configuration wasn't being picked up in the extending configuration, while everything worked fine when adding the property directly on the former.Anyway, seems like the new V4 will support
ts-jestwhich should manage inheritance correctly (it used native TS configuration management), so I guess the problem will be solved in some time.Cya!