Skip to content

Commit

Permalink
chore: adding jest
Browse files Browse the repository at this point in the history
  • Loading branch information
Berchez committed Sep 29, 2024
1 parent af97777 commit c608f17
Show file tree
Hide file tree
Showing 4 changed files with 2,465 additions and 41 deletions.
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: 'jsdom',
// 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);
20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"postinstall": "patch-package"
"postinstall": "patch-package",
"test": "jest"
},
"dependencies": {
"@testing-library/react-hooks": "^8.0.1",
"@types/axios": "^0.14.0",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
Expand All @@ -21,19 +23,27 @@
"react": "^18",
"react-dom": "^18",
"react-toastify": "^10.0.5",
"steamapi": "^3.0.8"
"steamapi": "^3.0.8",
"testing-library": "^0.0.2"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.2.13",
"@types/node": "^20",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@types/jest": "^29.5.13",
"@types/node": "^20.16.5",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.1.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"patch-package": "^8.0.0",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
}
}
}
Loading

0 comments on commit c608f17

Please sign in to comment.