Skip to content

Instantly share code, notes, and snippets.

@Kjaer
Last active October 15, 2019 15:22
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 Kjaer/f10cf953ac1b649ad1d036db79209d0f to your computer and use it in GitHub Desktop.
Save Kjaer/f10cf953ac1b649ad1d036db79209d0f to your computer and use it in GitHub Desktop.
"Setting up Jest and Enzyme for Typescript Next.js apps" post gists
module.exports = {
"testEnvironment": "node",
"roots": [
"<rootDir>/components"
],
"preset": "ts-jest",
"setupFilesAfterEnv": ["<rootDir>/tests/setupTests.ts"],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"testPathIgnorePatterns": ["<rootDir>/.next/", "<rootDir>/node_modules/"],
"snapshotSerializers": ["enzyme-to-json/serializer"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment