Skip to content

Commit

Permalink
set up vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmcadam committed Aug 1, 2024
1 parent f3cd25a commit c8aeaef
Show file tree
Hide file tree
Showing 4 changed files with 784 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

on:
pull_request:

jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Run tests
run: pnpm test
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"lint": "next lint",
"prettier": "prettier --check 'src/**/*.{ts,tsx,js,jsx,html,css}'",
"prettier:fix": "prettier --check --write 'src/**/*.{ts,tsx,js,jsx,html,css}'",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"test": "vitest src"
},
"dependencies": {
"@radix-ui/react-slot": "^1.1.0",
Expand All @@ -32,6 +33,7 @@
"postcss": "^8",
"prettier": "3.3.3",
"tailwindcss": "^3.4.1",
"typescript": "^5"
"typescript": "^5",
"vitest": "^2.0.5"
}
}
Loading

0 comments on commit c8aeaef

Please sign in to comment.