Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run Tests

on:
push:
branches: [ main ] # Or your default branch
pull_request:
branches: [ main ] # Or your default branch

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Specify a Node.js version compatible with your project

# It's good practice to cache dependencies to speed up workflows.
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install pnpm
run: npm install -g [email protected] # Using a specific version that was problematic locally, good to test in CI

- name: Install dependencies
run: pnpm install

- name: Run tests
run: pnpm test
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"init-msw": "msw init public/"
"init-msw": "msw init public/",
"test": "vitest",
"test:ui": "vitest --ui"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
Expand All @@ -60,7 +62,12 @@
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.1",
"vite-plugin-dts": "^4.5.4"
"vite-plugin-dts": "^4.5.4",
"vitest": "^1.6.0",
"@vitest/ui": "^1.6.0",
"jsdom": "^24.1.0",
"@testing-library/react": "^16.0.0",
"@testing-library/jest-dom": "^6.4.6"
},
"resolutions": {
"jackspeak": "2.1.1"
Expand Down
Loading