Importing libraries in setupTests.ts throws TypeScript errors #103
Labels
kind: support
Asking for support with something or a specific use case
solution: intended behavior
This is not a bug and is expected behavior
Current Behavior
The following imports in setupTests.ts throw Typescript errors:
The above throws "ReferenceError: afterEach is not defined"
The above throws "ReferenceError: expect is not defined"
It is as if Jest does not recognize its own globals.
The same imports work correctly in test files.
Expected behavior
Library imports should work correctly in setup files.
Additional context
Here's my repo that shows this issue: https://github.com/nareshbhatia/react-base-tsdx
Currently the above imports are in the test files, so they work correctly. Just try
yarn test
.Now uncomment the same imports in setupTests.ts (one at a time) and run
yarn test
. You will see the errors.Your environment
The text was updated successfully, but these errors were encountered: