Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add test:ui script to visualize and interact with tests #494

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.