Skip to content

Commit

Permalink
fix(jest): fix jest type
Browse files Browse the repository at this point in the history
  • Loading branch information
jerensl committed Oct 16, 2023
1 parent c88b1f8 commit 2f72604
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 1 addition & 3 deletions __tests__/pages/project/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/**
* @jest-environment jsdom
*/
import '@testing-library/jest-dom'
import React from 'react'
import { render, within } from '../../../__mocks__/utils/test-providers'
import Project from '../../../src/pages/project/index'
Expand Down
3 changes: 2 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const createJestConfig = nextJest({
})

// Add any custom config to be passed to Jest
/** @type {import('jest').Config} */
const customJestConfig = {
setupFiles: [require.resolve('whatwg-fetch')],
setupFilesAfterEnv: [
Expand All @@ -23,7 +24,7 @@ const customJestConfig = {
'<rootDir>/cypress/',
],
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jsdom',
testEnvironment: 'jest-environment-jsdom',
preset: 'ts-jest',
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'mjs'],
transform: {
Expand Down
9 changes: 8 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
"@/*": ["*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "commitlint.config.cts", "commitlint.config.cts", "jest.setup.js"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"commitlint.config.ts",
"commitlint.config.ts",
"jest.setup.ts"
],
"exclude": ["node_modules"]
}

0 comments on commit 2f72604

Please sign in to comment.