-
Notifications
You must be signed in to change notification settings - Fork 1
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
How to specify path to tsconfig.json? #202
Comments
It is not possible to specify the path explicitly.
├── __typetests__
│ └── SampleType.test.ts
│ └── tsconfig.json
├── package.json
├── tsconfig.json
└── tsconfig.typetest.json Here the file {
"extends": "../tsconfig.typetest.json",
"include": ["./**/*"]
} This is more or less how type testing is set up in Jest repo, see: https://github.com/jestjs/jest/blob/main/packages/expect/__typetests__/ Other solutions are possible. If the above suggestion does not work for your file structure, please provide more details on your setup. The thing is that it is rather clumsy to pass additional options to the runners. For instance, Jest would not allow a |
We have the tests in the same folder as the component they're testing. So having a parent
The main
|
Thanks for the details. Does your {
"references": [{ "path": "./tsconfig.test.json" }]
} So that IDE could pick up the right config for test files? Reference: https://vite.new/react-ts Ideally The solution to this problem is coming with brand new type testing tool which is mentioned in #32. It respects all fields of TSConfig and picks up configuration just like IDEs do. (I.e. the Currently I work on documentation. The plan is to publish the package in some 2-3 months. The sooner the better, of course (; |
Thanks! We don't currently pass tsconfig.test.json to Anyway, I ended up auto-generating the typing tests for all components on the fly when running tests, and running the resulting temporary file in a folder with a tsconfig.json. So I'm unblocked for now :) |
Just a quick note, the testing tool I was mentioning before is freshly published. For details, see: #32 (comment) So I think we can close this for now. |
jest-runner-tsd is finding the wrong tsconfig.json (the one in a package subdirectory), instead of the correct one we use for tests (tsconfig.test.json at the root of the repo).
How can I tell jest-runner-tsd to use this custom tsconfig file?
The text was updated successfully, but these errors were encountered: