Skip to content

Instantly share code, notes, and snippets.

@JustJenFelice
Forked from thebuilder/jest.config.js
Created May 26, 2021 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustJenFelice/4bb9cb5225bfa793cc4aaf76ed7bc55c to your computer and use it in GitHub Desktop.
Save JustJenFelice/4bb9cb5225bfa793cc4aaf76ed7bc55c to your computer and use it in GitHub Desktop.
Use Jest Projects to run both JSDom and Node tests in the same project
module.exports = {
projects: [
{
displayName: 'dom',
testEnvironment: 'jsdom',
snapshotSerializers: ['enzyme-to-json/serializer'],
testMatch: ['**/__tests__/**/*.test.js?(x)']
},
{
displayName: 'node',
testEnvironment: 'node',
testMatch: [
'**/__tests__/**/*.test.node.js?(x)',
]
},
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment