Tests pass even when there are TypeScript errorsSee original GitHub issue
According to https://github.com/facebook/create-react-app/issues/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 in
- Created 2 years ago
- Comments:7 (7 by maintainers)