Global installation section is outdated
It appears the "setupTestFrameworkScriptFile" option for Jest configuration is now deprecated in favor of "setupFilesAfterEnv"
https://jestjs.io/docs/en/configuration.html#setupfilesafterenv-array
I second this, and can maybe roll out a PR to update?
https://github.com/styled-components/jest-styled-components#global-installation
It might also useful to include the common version of the import for CRA users.
Hello, I would suggest leaving both options available. In case the user is not setting any other package the setupTests.js file is not needed. I propose something like this:
Global installation
It is possible to setup this package for all the tests.
Using setupTests.js file (recommended for CRA)
Import the library once in the src/setupTests.js as follows:
import 'jest-styled-components'
Configuration Option
Include 'jest-styled-components' in the setupFilesAfterEnv option. Example setupFilesAfterEnv array in a jest.config.js:
module.exports = {
setupFilesAfterEnv: ['jest-styled-components'],
};
update: an example here https://github.com/wachunei/directUC/pull/122/files