Skip to content

Commit

Permalink
set up vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle committed Dec 27, 2023
1 parent 5b567f1 commit dcb3aa0
Show file tree
Hide file tree
Showing 5 changed files with 583 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
env:
CI: true

- name: Test 🧪
run: yarn test

- name: Build 🛠
run: |
yarn build
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
"eslint": "^8.56.0",
"eslint-config-kyle": "^17.0.2",
"typescript": "^5.1.6",
"vite": "^4.4.8"
"vite": "^4.4.8",
"vitest": "^0.34.6"
},
"scripts": {
"lint": "eslint --ext .ts,.tsx,.js --ignore-path .gitignore . && tsc",
"test": "vitest",
"start": "vite",
"build": "vite build"
},
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"types": ["vite/client"],
"types": ["vite/client", "vitest/globals"],
"downlevelIteration": true,
"jsx": "react-jsx"
},
Expand Down
5 changes: 4 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from 'vite';
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
/* eslint-enable import/no-extraneous-dependencies */

Expand All @@ -13,4 +13,7 @@ export default defineConfig({
build: {
outDir: './build',
},
test: {
globals: true,
},
});
Loading

0 comments on commit dcb3aa0

Please sign in to comment.