Skip to content

Commit

Permalink
Merge pull request #72 from TeamHSE/feat/ui-tests
Browse files Browse the repository at this point in the history
Frontend tests
  • Loading branch information
AleksanderNekr authored Jun 22, 2024
2 parents 5f1cc8b + 5c4549a commit f365116
Show file tree
Hide file tree
Showing 7 changed files with 2,460 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-front.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
node-version: [ 20.x ]

defaults:
run:
working-directory: ./frontend
Expand All @@ -39,3 +39,6 @@ jobs:

- name: Build Project
run: pnpm build

- name: Run Tests
run: pnpm test
11 changes: 11 additions & 0 deletions frontend/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Config } from "@jest/types";

const config: Config.InitialOptions = {
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1"
}
};

export default config;
9 changes: 8 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start -p 3001",
"lint": "next lint"
"lint": "next lint",
"test": "jest --config=jest.config.ts"
},
"dependencies": {
"@jest/types": "^29.6.3",
"@tanstack/react-query": "^5.45.0",
"@tanstack/react-query-devtools": "^5.45.0",
"@types/js-cookie": "^3.0.6",
Expand All @@ -28,12 +30,17 @@
"sonner": "^1.5.0"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.12",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"eslint-config-prettier": "^9.1.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.5",
"ts-node": "^10.9.2",
"typescript": "^5"
}
}
Loading

0 comments on commit f365116

Please sign in to comment.