Skip to content

Commit fbe10a2

Browse files
authored
Merge pull request #397 from spences10/feat/add-unit-tests
2 parents b6fbc43 + 7b5da8b commit fbe10a2

22 files changed

+1386
-128
lines changed

.github/workflows/unit-test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Tests: Unit'
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
unit_tests:
7+
name: Run unit tests
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: pnpm/action-setup@v2.2.4
11+
with:
12+
version: 6.0.2
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
- name: Install pnpm
16+
run: pnpm i
17+
- name: Build
18+
run: pnpm run build
19+
env:
20+
PUBLIC_FATHOM_ID: ${{ secrets.PUBLIC_FATHOM_ID }}
21+
PUBLIC_FATHOM_URL: ${{ secrets.PUBLIC_FATHOM_URL }}
22+
- name: Test
23+
run: pnpm run test:ci

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
"format": "pretty-quick",
2929
"package:local": "svelte-package && pnpm i -D ./package",
3030
"contributors:add": "all-contributors add",
31-
"contributors:generate": "all-contributors generate"
31+
"contributors:generate": "all-contributors generate",
32+
"test:unit": "vitest",
33+
"test:ui": "vitest --ui",
34+
"test:ci": "vitest run"
3235
},
3336
"husky": {
3437
"hooks": {
@@ -41,8 +44,10 @@
4144
"@sveltejs/kit": "next",
4245
"@sveltejs/package": "1.0.1",
4346
"@tailwindcss/typography": "0.5.8",
47+
"@testing-library/svelte": "^3.2.2",
4448
"@typescript-eslint/eslint-plugin": "5.46.1",
4549
"@typescript-eslint/parser": "5.46.1",
50+
"@vitest/ui": "^0.25.8",
4651
"all-contributors-cli": "6.24.0",
4752
"autoprefixer": "10.4.13",
4853
"daisyui": "2.45.0",
@@ -51,6 +56,7 @@
5156
"eslint-plugin-svelte3": "4.0.0",
5257
"fathom-client": "^3.5.0",
5358
"husky": "8.0.2",
59+
"jsdom": "^20.0.3",
5460
"mdsvex": "0.10.6",
5561
"postcss": "8.4.20",
5662
"postcss-load-config": "4.0.1",
@@ -68,7 +74,8 @@
6874
"tailwindcss": "3.2.4",
6975
"tslib": "2.4.1",
7076
"typescript": "4.9.4",
71-
"vite": "4.0.1"
77+
"vite": "4.0.1",
78+
"vitest": "^0.25.8"
7279
},
7380
"type": "module",
7481
"repository": {

0 commit comments

Comments
 (0)