Skip to content

Commit

Permalink
chore: use vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
jeasonstudio committed Jan 25, 2024
1 parent 47b6125 commit a32329c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Build
run: pnpm run build

- name: Run jest
- name: Run test
run: pnpm run test:ci

- name: Upload coverage reports to Codecov
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,4 @@ dist
.pnp.*

grammar/.antlr/*
html
29 changes: 0 additions & 29 deletions jest.config.cjs

This file was deleted.

11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.11",
"@types/lodash-es": "^4.17.12",
"@umijs/fabric": "^4.0.1",
"@vitest/coverage-v8": "^1.2.1",
Expand All @@ -72,7 +70,6 @@
"changeset": "^0.2.6",
"eslint": "^8.56.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"lint-staged": "^15.2.0",
"prettier": "^3.2.4",
"typedoc": "^0.25.4",
Expand All @@ -95,10 +92,10 @@
"prepublishOnly": "npm run build",
"changeset": "changeset",
"release": "changeset version && changeset publish",
"test": "jest",
"test:coverage": "jest --coverage",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
"test:ci": "jest --coverage --maxWorkers=4 --forceExit",
"test": "vitest",
"test:coverage": "vitest --coverage",
"test:ui": "vitest --ui",
"test:ci": "npm run test:coverage",
"lint": "pnpm run \"/^lint:.+/\"",
"lint:eslint": "eslint --quiet --fix --ext .ts .",
"lint:prettier": "prettier **/*.ts --log-level warn --write",
Expand Down
8 changes: 5 additions & 3 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
// reporters: ['json', 'text', 'text-summary', 'html', 'cobertura'],
// reporters: ['basic', 'html', 'json'],
include: ['**/*.(test|spec).(t|j)s'],
// reporters: ['default', 'html'],
coverage: {
include: ['src/**/*.ts'],
exclude: ['node_modules', 'dist', '.idea', '.git', '.cache', 'src/antlr4', 'docs'],
},
},
});

0 comments on commit a32329c

Please sign in to comment.