Last active
April 9, 2023 11:35
-
-
Save shawn-sandy/0d22967acffb39d8637a91a7fd9d15f6 to your computer and use it in GitHub Desktop.
nextra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const nextJest = require('next/jest') | |
const createJestConfig = nextJest({ | |
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment | |
dir: './', | |
}) | |
// Add any custom config to be passed to Jest | |
const customJestConfig = { | |
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'], | |
testEnvironment: 'jest-environment-jsdom', | |
} | |
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async | |
module.exports = createJestConfig(customJestConfig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optional: configure or set up a testing framework before each test. | |
// If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js` | |
// Used for __tests__/testing-library.js | |
// Learn more: https://github.com/testing-library/jest-dom | |
import '@testing-library/jest-dom/extend-expect' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"devDependencies": { | |
"@testing-library/dom": "^9.0.1", | |
"@testing-library/jest-dom": "^5.16.5", | |
"@testing-library/react": "^14.0.0", | |
"@testing-library/user-event": "^14.4.3", | |
"@types/node": "18.11.18", | |
"@types/testing-library__jest-dom": "^5.14.5", | |
"jest": "^29.5.0", | |
"jest-environment-jsdom": "^29.5.0", | |
"tilg": "^0.1.1", | |
"tsconfig-paths": "^4.1.2", | |
"typescript": "^4.9.5" | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment