Skip to content

Commit

Permalink
Merge pull request #494 from w2xi/master
Browse files Browse the repository at this point in the history
chore: add `test:ui` script to visualize and interact with tests
  • Loading branch information
Tyh2001 authored Sep 10, 2024
2 parents 357c138 + f216ad0 commit 338bde1
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 11 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ fighting-design 内部设置了很多的命令,在 [package.json](https://gith
| `new` | `pnpm new xxx` | 构建全新组件,生产组件所需要的文件,执行配置文件 [index.ts](https://github.com/FightingDesign/fighting-design/blob/master/packages/fighting-add-component/index.ts),详情参考 [README.md](https://github.com/FightingDesign/fighting-design/blob/master/packages/fighting-add-component/README.md) |
| `test` | `pnpm test` | 执行单元测试 |
| `test:coverage` | `pnpm test:coverage` | 查看单元测试覆盖率,可在终端中生成覆盖率,也可查看项目根目录下的 `coverage/index.html`,参考 [Coverage](https://vitest.dev/guide/coverage.html) |
| `test:ui` | `pnpm test:ui` | 提供了一个可视化的界面来查看单元测试并与之交互,参考 [Vitest UI](https://vitest.dev/guide/ui) |
| `prettier` | `pnpm prettier` | 全局格式化 |
| `commit` | `pnpm commit` | commit 钩子 |
| `lint` | `pnpm lint` | 全局 eslint 检测,规则参考 [](https://github.com/FightingDesign/fighting-design/blob/master/packages/eslint-config/index.js) |
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ fighting-design 内部设置了很多的命令,在 [package.json](https://gith
| `new` | `pnpm new xxx` | 构建全新组件,生产组件所需要的文件,执行配置文件 [index.ts](https://github.com/FightingDesign/fighting-design/blob/master/packages/fighting-add-component/index.ts),详情参考 [README.md](https://github.com/FightingDesign/fighting-design/blob/master/packages/fighting-add-component/README.md) |
| `test` | `pnpm test` | 执行单元测试 |
| `test:coverage` | `pnpm test:coverage` | 查看单元测试覆盖率,可在终端中生成覆盖率,也可查看项目根目录下的 `coverage/index.html`,参考 [Coverage](https://vitest.dev/guide/coverage.html) |
| `test:ui` | `pnpm test:ui` | 提供了一个可视化的界面来查看单元测试并与之交互,参考 [Vitest UI](https://vitest.dev/guide/ui) |
| `prettier` | `pnpm prettier` | 全局格式化 |
| `commit` | `pnpm commit` | commit 钩子 |
| `lint` | `pnpm lint` | 全局 eslint 检测,规则参考 [](https://github.com/FightingDesign/fighting-design/blob/master/packages/eslint-config/index.js) |
Expand Down
1 change: 1 addition & 0 deletions docs/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ fighting-design 内部设置了很多的命令,在 [package.json](https://gith
| `new` | `pnpm new xxx` | 构建全新组件,生产组件所需要的文件,执行配置文件 [index.ts](https://github.com/FightingDesign/fighting-design/blob/master/packages/fighting-add-component/index.ts),详情参考 [README.md](https://github.com/FightingDesign/fighting-design/blob/master/packages/fighting-add-component/README.md) |
| `test` | `pnpm test` | 执行单元测试 |
| `test:coverage` | `pnpm test:coverage` | 查看单元测试覆盖率,可在终端中生成覆盖率,也可查看项目根目录下的 `coverage/index.html`,参考 [Coverage](https://vitest.dev/guide/coverage.html) |
| `test:ui` | `pnpm test:ui` | 提供了一个可视化的界面来查看单元测试并与之交互,参考 [Vitest UI](https://vitest.dev/guide/ui) |
| `prettier` | `pnpm prettier` | 全局格式化 |
| `commit` | `pnpm commit` | commit 钩子 |
| `lint` | `pnpm lint` | 全局 eslint 检测,规则参考 [](https://github.com/FightingDesign/fighting-design/blob/master/packages/eslint-config/index.js) |
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"serve:docs": "pnpm run -C docs serve",
"new": "pnpm run -C packages/fighting-add-component new",
"test": "vitest",
"test:ui": "vitest --ui",
"test:coverage": "vitest --coverage",
"prettier": "prettier --write .",
"commit": "cz",
Expand All @@ -46,6 +47,7 @@
"@types/node": "^22.0.0",
"@vitejs/plugin-vue": "^5.0.4",
"@vitest/coverage-v8": "^2.0.4",
"@vitest/ui": "^2.0.5",
"@vue/test-utils": "^2.4.5",
"autoprefixer": "^10.4.13",
"commitizen": "^4.2.4",
Expand Down
98 changes: 87 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 338bde1

Please sign in to comment.