Skip to content

Commit d69fac4

Browse files
authored
feat: add initial unit tests (#38)
* chore: configure vitest * chore: install msw * chore: install testing-library, jsdom * chore: configure vitest * test: add PromptList * test: refactor PromptList * test: refactor fixtures name * chore: add custom render with providers * chore: refactor import name * test: add Chat test case * chore: add packages * chore: add mock on vitest * test: add Dashboard tests * test: add App tests * test: add CopyToClipboard * test: add Certificates test * test: add useSee test * test: useBreadcrumb * chore: vite config tresholds * chore: add GH workflow for running unit tests * test: fix time
1 parent 6e5756c commit d69fac4

29 files changed

+7060
-1471
lines changed

Diff for: .github/workflows/_unit-tests.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Unit Tests
2+
permissions: write-all
3+
on:
4+
workflow_call:
5+
jobs:
6+
tests:
7+
name: Vitest
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Repository
11+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
12+
13+
- name: Setup
14+
uses: ./.github/actions/setup
15+
16+
- name: Run tests
17+
run: npm run test:coverage

Diff for: .github/workflows/on-pr.yml

+5
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ jobs:
1111
name: Static Checks
1212
uses: ./.github/workflows/_static-checks.yml
1313
secrets: inherit
14+
15+
unit-tests:
16+
name: Unit Tests
17+
uses: ./.github/workflows/_unit-tests.yml
18+
secrets: inherit

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ dist
1212
dist-ssr
1313
*.local
1414

15+
# testing
16+
/coverage
17+
1518
# typescript
1619
*.tsbuildinfo
1720
next-env.d.ts

0 commit comments

Comments
 (0)