Current Behavior
The following imports in setupTests.ts throw Typescript errors:
import 'react-testing-library/cleanup-after-each';
The above throws "ReferenceError: afterEach is not defined"
import 'jest-dom/extend-expect';
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
| Software |
Version(s) |
| TSDX |
0.5.9 |
| TypeScript |
3.4.5 |
| Browser |
N/A |
| npm/Yarn |
Yarn 1.15.2 |
| Operating System |
MacOS |
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