Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit ee52c3d

Browse files
committed
✨ Jest
1 parent b7b4a78 commit ee52c3d

File tree

4 files changed

+13385
-7386
lines changed

4 files changed

+13385
-7386
lines changed

jest.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const nextJest = require('next/jest');
2+
const createJestConfig = nextJest({
3+
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
4+
dir: './',
5+
});
6+
// Add any custom config to be passed to Jest
7+
const customJestConfig = {
8+
setupFiles: ['text-encoding'],
9+
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/'],
10+
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
11+
testEnvironment: 'jsdom',
12+
};
13+
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
14+
module.exports = createJestConfig(customJestConfig);

jest.setup.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '@testing-library/jest-dom';
2+
import '@testing-library/react';

0 commit comments

Comments
 (0)