-
Notifications
You must be signed in to change notification settings - Fork 76
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
Tests pass even when there are TypeScript errors #851
Comments
Is this why tests are passing CI but failing locally? |
No don't think so, that's a separate issue. I think the tests failing locally is something weird with the mocks not working again... not sure why CI likes the workaround but not our machine locally sometimes 🤷 This is more to do with the fact if you add a new prop to a component and you don't update the tests, sometimes it stills passes (when it should fail like in the main app) |
Hi everyone! I would love to pick up this issue (and join the development team if I may :) ). |
Assigned! Also send me an email (address on my profile) |
One other thing I forgot to write in the first description, can you also look at linting the test files too while you are in the area please? I think these are all related enough issues that it'd be good to fix them together. Apologies if that might mean more files to fix 😬 |
According to facebook/create-react-app#5626, there's a limitation in how Create React App sets out jest, which means type checking isn't being done properly on test files. That means tests could still be passing even if they should break because of TS error.
The workaround seems to be adding
tsc
before running the tests so the test files goes through the TS type checker and only run the tests if succeeds. Will have to fix some broken test files as a result of this.Also, linting also don't seem to be applied to test files which would normally fail the app build, so we may need to add a similar workaround to the above by running the
eslint
command against files ending intest.ts[x]*
.The text was updated successfully, but these errors were encountered: