Skip to content

Commit

Permalink
checking the frontend workflow unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
prishavall committed Mar 9, 2024
1 parent 7ceaad2 commit 5c91125
Show file tree
Hide file tree
Showing 5 changed files with 2,298 additions and 58 deletions.
6 changes: 0 additions & 6 deletions frontend/jest.config.js

This file was deleted.

22 changes: 22 additions & 0 deletions frontend/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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 = {
preset: "ts-jest",
transform: {
"^.+\.tsx?$": "babel-jest",
},
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)
10 changes: 9 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"lint": "next lint",
"start": "next dev"
"start": "next dev",
"test": "jest",
"test:watch": "jest --watch"
},
"keywords": [],
"author": "",
Expand Down Expand Up @@ -56,13 +58,19 @@
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.0.1",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@types/react-dom": "^18.2.18",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"depcheck": "^1.4.7",
"eslint": "^8.52.0",
"eslint-plugin-react": "^7.33.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "3.2.2",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit 5c91125

Please sign in to comment.