Skip to content

Commit

Permalink
[Docs] Testing docs: Comment out optional config that points to a file (
Browse files Browse the repository at this point in the history
vercel#33827)

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

This prevents users who copy and paste the options without creating the associated file from experiencing an error. The option is explained in the Jest Docs and in the `Optional: Extend Jest with custom matchers` section.
  • Loading branch information
delbaoliveira authored and natew committed Feb 16, 2022
1 parent 295d34b commit 9b5f776
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/testing.md
Expand Up @@ -281,7 +281,8 @@ const createJestConfig = nextJest({

// Add any custom config to be passed to Jest
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
// if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
Expand Down Expand Up @@ -329,7 +330,8 @@ module.exports = {
// Handle module aliases
'^@/components/(.*)$': '<rootDir>/components/$1',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/.next/'],
testEnvironment: 'jsdom',
transform: {
Expand Down

0 comments on commit 9b5f776

Please sign in to comment.