Skip to content

Commit 4b0809e

Browse files
authored
Merge pull request #55 from coder/brett/add-testing-libraries
chore: setup testing libraries and tests for App.tsx
2 parents 0fb1d17 + 97057a7 commit 4b0809e

File tree

7 files changed

+720
-4
lines changed

7 files changed

+720
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
25+
- name: Install dependencies
26+
run: pnpm install
27+
28+
- name: Run tests
29+
run: pnpm test

biome.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"clientKind": "git"
66
},
77
"files": {
8-
"includes": ["src/**/*", "!src/client/gen/types.ts","!pnpm-lock.yaml"],
8+
"includes": ["**/*.config.ts", "src/**/*", "!src/client/gen/types.ts","!pnpm-lock.yaml"],
99
"ignoreUnknown": true
1010
},
1111
"linter": {

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"dev": "vite",
88
"build": "tsc -b && vite build && vite build --mode=client",
99
"lint": "eslint .",
10-
"preview": "vite preview"
10+
"preview": "vite preview",
11+
"test": "vitest",
12+
"test:ui": "vitest --ui",
13+
"test:run": "vitest run",
14+
"test:coverage": "vitest run --coverage",
15+
"test:watch": "vitest watch"
1116
},
1217
"dependencies": {
1318
"@fontsource-variable/inter": "^5.2.5",
@@ -60,6 +65,8 @@
6065
"@biomejs/biome": "2.1.1",
6166
"@eslint/js": "^9.25.0",
6267
"@hono/vite-dev-server": "^0.19.1",
68+
"@testing-library/jest-dom": "^6.6.4",
69+
"@testing-library/react": "^16.3.0",
6370
"@types/lodash": "^4.17.17",
6471
"@types/node": "^22.15.21",
6572
"@types/prismjs": "^1.26.5",
@@ -73,12 +80,15 @@
7380
"eslint-plugin-react-hooks": "^5.2.0",
7481
"eslint-plugin-react-refresh": "^0.4.19",
7582
"globals": "^16.0.0",
83+
"happy-dom": "^18.0.1",
7684
"postcss": "^8.5.3",
7785
"tailwindcss": "3",
7886
"typescript": "~5.8.3",
7987
"typescript-eslint": "^8.30.1",
8088
"vercel": "^42.3.0",
8189
"vite": "^6.3.5",
82-
"vite-plugin-vercel": "^9.0.7"
83-
}
90+
"vite-plugin-vercel": "^9.0.7",
91+
"vitest": "^3.2.4"
92+
},
93+
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
8494
}

0 commit comments

Comments
 (0)