This line in particular:
|
act = require("@testing-library/react").act; |
imports from @testing-library/react
it should be
@testing-library/react/pure
Importing from @testing-library/react directly adds a afterEach that clears the DOM between each jest test
@testing-library/react/dist/index.js
// if we're running in a test runner that supports afterEach
// or teardown then we'll automatically run cleanup afterEach test
// this ensures that tests run in isolation from each other
// if you don't like this then either import the `pure` module
// or set the RTL_SKIP_AUTO_CLEANUP env variable to 'true'.
if (typeof process === 'undefined' || !((_process$env = process.env) != null && _process$env.RTL_SKIP_AUTO_CLEANUP)) {
// ignore teardown() in code coverage because Jest does not support it
/* istanbul ignore else */
if (typeof afterEach === 'function') {
afterEach(() => {
(0, _pure.cleanup)();
});
} else if (typeof teardown === 'function') {
// Block is guarded by `typeof` check.
// eslint does not support `typeof` guards.
// eslint-disable-next-line no-undef
teardown(() => {
(0, _pure.cleanup)();
});
}
}
This line in particular:
react-select-event/src/act-compat.ts
Line 18 in 8619e8b
imports from
@testing-library/reactit should be
@testing-library/react/pureImporting from
@testing-library/reactdirectly adds aafterEachthat clears the DOM between each jest test@testing-library/react/dist/index.js