Skip to content

Commit

Permalink
fix: jest config (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xArdy authored May 9, 2024
1 parent 872ae3f commit 6c8aebf
Show file tree
Hide file tree
Showing 6 changed files with 337 additions and 31 deletions.
9 changes: 0 additions & 9 deletions jest.config.js

This file was deleted.

18 changes: 18 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Config } from 'jest';
import nextJest from 'next/jest.js';

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 config: Config = {
coverageProvider: 'v8',
testEnvironment: 'node',
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
};

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
export default createJestConfig(config);
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@
"eslint-plugin-react-refresh": "0.4.3",
"husky": "8.0.3",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jsdom": "24.0.0",
"lodash.merge": "4.6.2",
"prettier": "3.0.3",
"styled-components": "6.0.7",
"ts-jest": "29.1.2",
"ts-node": "10.9.2",
"typescript": "5.4.2"
}
}
Loading

0 comments on commit 6c8aebf

Please sign in to comment.