Skip to content

Commit

Permalink
feat: upgrade to Vitest 2 (#690)
Browse files Browse the repository at this point in the history
* test: upgrade to vitest 2, and add browser testing

* test: install playwright on matrix tests

* chore: upgrade package.json

* fix: use `beforeAll` instead of `beforeEach` to initiate mocks
  • Loading branch information
thebuilder authored Jul 11, 2024
1 parent e3f8129 commit 054adf4
Show file tree
Hide file tree
Showing 11 changed files with 1,134 additions and 2,091 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ jobs:
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Install playwright
run: pnpx playwright install chromium
- name: Lint
run: pnpm biome ci .
- name: Test
run: pnpm test
run: pnpm vitest --coverage
env:
CI: true
- name: Build
Expand Down Expand Up @@ -57,4 +59,5 @@ jobs:
- name: Validate types
run: |
pnpm tsc
pnpx playwright install chromium
pnpm test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ npm-debug.log*
*.log
storybook-static
test-utils.js
test-utils.d.ts
test-utils.d.ts
__screenshots__
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"lint": "biome check .",
"version": "pnpm build",
"storybook:build": "pnpm build:bundle && pnpm --filter storybook build",
"test": "vitest"
"test": "vitest",
"test:browser": "vitest --workspace=vitest.workspace.ts"
},
"keywords": [
"react",
Expand Down Expand Up @@ -107,20 +108,23 @@
"@size-limit/preset-small-lib": "^11.1.4",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@types/jest": "^29.5.12",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/browser": "^2.0.1",
"@vitest/coverage-istanbul": "^2.0.1",
"jsdom": "^24.1.0",
"lint-staged": "^15.2.7",
"microbundle": "^0.15.1",
"npm-run-all": "^4.1.5",
"playwright": "^1.45.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"simple-git-hooks": "^2.11.1",
"size-limit": "^11.1.4",
"tsup": "^8.1.0",
"typescript": "^5.5.3",
"vitest": "^1.6.0"
"vitest": "^2.0.1"
},
"peerDependenciesMeta": {
"react-dom": {
Expand Down
Loading

0 comments on commit 054adf4

Please sign in to comment.