Skip to content

Commit

Permalink
Setup testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hstandaert committed Apr 12, 2024
1 parent ecddbf9 commit 2e948cb
Show file tree
Hide file tree
Showing 12 changed files with 2,772 additions and 27 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code quality
name: Continuous Integration

on:
push:
Expand All @@ -10,9 +10,34 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest

- name: Run Biome
run: biome ci .

tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: 🧪 Run tests
run: pnpm run test
11 changes: 11 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
testEnvironment: "jsdom",
transform: {
"^.+\\.tsx?$": "ts-jest",
},
moduleNameMapper: {
"\\.(gif|ttf|eot|svg|png)$": "<rootDir>/test/__mocks__/fileMock.ts",
"^@/(.*)$": "<rootDir>/src/$1",
},
setupFilesAfterEnv: ["./test/setupTests.ts"],
};
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"test": "NODE_ENV=test jest",
"dev": "vite",
"build": "tsc && vite build",
"lint": "biome lint .",
Expand All @@ -17,15 +18,24 @@
},
"devDependencies": {
"@biomejs/biome": "1.6.1",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.1",
"@types/jest": "^29.5.12",
"@types/jest-axe": "^3.5.9",
"@types/node": "^20.11.26",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.18",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-axe": "^8.0.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.2.2",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.2.2",
"vite": "^5.1.6"
}
Expand Down
Loading

0 comments on commit 2e948cb

Please sign in to comment.