-
Notifications
You must be signed in to change notification settings - Fork 156
implements a custom typescript config possibility in compilers/typesc… #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ript-compiler.js If a tsconfig.jest.json is found it will load that one instead of the default tsconfig.json
if (!fs.existsSync(tscPath+ '/'+ tscFile)){ | ||
tscFile = false | ||
} | ||
const { config } = tsconfig.loadSync(tscPath, tscFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use a jest global to get the file name, similarly to how ts-jest does it—https://github.com/kulshekhar/ts-jest/blob/master/src/preprocessor.ts#L17
You can pass a global in in the Jest config object:
{
"jest": {
"globals": {
"vue-jest": {
"tsConfigFile": "my-tsconfig.json"
}
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR 😀
In order to get this merged in, we should refactor it to use a jest config value for the filename.
We also need to add tests to check that this works correctly
@@ -1,11 +1,13 @@ | |||
# vue-jest | |||
# vue-jest-kn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you changed the package name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had to change it temporarily to have an npm with it to integrate.
Will be changed back once I have the time to refactor to jest-globals.
Should have made another fork .. my bad ;)
@webforgeeu Are you still interested in working on this? I need this as well, but don't want to step on your toes if you're actively working on it / completing it soon. |
@dcherman |
…ript-compiler.js
If a tsconfig.jest.json is found it will load that one instead of the default tsconfig.json