Minimal setup required to use react-testing-library with Jest.
All examples featured here run using these exact config files.
module.exports = { setupFilesAfterEnv: ['./rtl.setup.js']};
module.exports = {
setupFilesAfterEnv: ['./rtl.setup.js']
};
// See https://github.com/kentcdodds/react-testing-library#global-configimport 'jest-dom/extend-expect';import 'react-testing-library/cleanup-after-each';
// See https://github.com/kentcdodds/react-testing-library#global-config
import 'jest-dom/extend-expect';
import 'react-testing-library/cleanup-after-each';