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
Integrate a runner and reporter for testing types #4
Comments
Could probably draw inspiration from |
@sauravhiremath @jevakallio @smartclash I have updated the Summary, Todos and Test Plan. Feedback required 👍 |
Since this issue is more of having to make a custom runner, we'll be making this as a separate project. Integrating it inside Jest itself could be a bad idea. You can follow the development of this runner at https://github.com/MLH-Fellowship/jest-runner-tsd/ |
I agree |
Sorry I never got back to this - the plan looks great! |
The underlying library (TSD) that we are planning to import needs some stuffs to be fixed. So, a fork has been made at https://github.com/MLH-Fellowship/tsd. They'll be fixed and we will be opening a PR to the origin. After it is merged it'll be used in custom runner that we are making. |
Final work plan: We'll be having a separate config file for jest, something like We'll also be adding a script inside About where to place the type definition test files, I think it would be great to place them under Or we can have a new folder inside Let me know which one is the better approach or if you have something better. No matter which approach, we have to configure References: |
If the PRs take time landing in upstream |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Type definitions help ensure your code is correct, but it’s also very useful to ensure your types are correct, especially if you ship types with your library. Ensuring that you get type errors where you expect is also useful, so your types don’t regress in functionality by accident. Being able to test your types next to your logic, with much the same API, will make it easier for people to maintain high quality type definitions.
This will help APIs injected into a test by Jest are well typed.
Test Plan
tsd
essentially runs the typescript compiler and injects assertions, which can be added in a custom runner which will run part of Jest's test suiteexpect
and differentjest
objects likejest.mock
, etcTodos
const a: import("jest").Expect
which would allow types to be passed around internally without too much churnReferences
The text was updated successfully, but these errors were encountered: