Skip to content

Instantly share code, notes, and snippets.

@ifeora-emeka
Forked from thebuilder/jest.config.js
Created September 15, 2021 22:35
Show Gist options
  • Save ifeora-emeka/fffe2c414abd0ea824d8944b5d041094 to your computer and use it in GitHub Desktop.
Save ifeora-emeka/fffe2c414abd0ea824d8944b5d041094 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