Skip to content

Instantly share code, notes, and snippets.

@YacheLee
Forked from LauraBeatris/jest_config.json
Created March 10, 2022 02:25
Show Gist options
  • Save YacheLee/a42e42cf33f9aa1e9aa3404d69caff31 to your computer and use it in GitHub Desktop.
Save YacheLee/a42e42cf33f9aa1e9aa3404d69caff31 to your computer and use it in GitHub Desktop.
Jest Configuration with Root Import
{
"jest": {
"testMatch": [
"**/__tests__/**/*.test.js"
],
"moduleNameMapper": {
"^~/(.*)": "<rootDir>/src/$1"
},
"setupFilesAfterEnv": [
"@testing-library/react/cleanup-after-each",
"@testing-library/jest-dom/extend-expect"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment