Loading...
Loading...
Compare original and translation side by side
package.jsonpackage.jsonAdd testing and CI/CD to this projectSet up Vitest with 80% coverage and GitHub Actions for this Next.js projectAdd testing and CI/CD to this projectSet up Vitest with 80% coverage and GitHub Actions for this Next.js projectbun add -D vitest @vitest/coverage-v8 @vitejs/plugin-react @testing-library/react @testing-library/jest-dom jsdomvitest.config.tssrc/test/setup.ts.github/workflows/ci.yml**/*.{test,spec}.{ts,tsx}bun add -D vitest @vitest/coverage-v8 @vitejs/plugin-react @testing-library/react @testing-library/jest-dom jsdomvitest.config.tssrc/test/setup.ts.github/workflows/ci.yml**/*.{test,spec}.{ts,tsx}bun add -D vitest @vitest/coverage-v8 supertest @types/supertestvitest.config.tstest/setup.ts.github/workflows/ci.ymlsrc/**/*.spec.tsbun add -D vitest @vitest/coverage-v8 supertest @types/supertestvitest.config.tstest/setup.ts.github/workflows/ci.ymlsrc/**/*.spec.tstemplates/| Template | Purpose |
|---|---|
| Vitest config for Next.js |
| Vitest config for NestJS |
| GitHub Actions for Next.js |
| GitHub Actions for NestJS |
| Test setup with RTL |
| Test setup for Node.js |
templates/| 模板文件 | 用途 |
|---|---|
| Next.js项目的Vitest配置 |
| NestJS项目的Vitest配置 |
| Next.js项目的GitHub Actions配置 |
| NestJS项目的GitHub Actions配置 |
| React项目的测试设置 |
| Node.js项目的测试设置 |
vitest.workspace.tsvitest.config.tsbun --filter '*' testvitest.workspace.tsvitest.config.tsbun --filter '*' test| Skill | Integration |
|---|---|
| Adds pre-commit coverage enforcement |
| Works alongside for code quality |
| Adds E2E testing after unit tests |
| Provides testing patterns guidance |
| 技能 | 集成说明 |
|---|---|
| 添加提交前覆盖率强制校验 |
| 配合使用以提升代码质量 |
| 在单元测试后添加端到端测试 |
| 提供测试模式指导 |
User: Add testing to this project
Claude:
1. Detects Next.js from package.json
2. Installs vitest, @vitest/coverage-v8, @testing-library/react
3. Creates vitest.config.ts with jsdom environment
4. Creates src/test/setup.ts
5. Creates .github/workflows/ci.yml
6. Adds test scripts to package.json用户:为这个项目添加测试
Claude:
1. 从package.json检测到Next.js项目
2. 安装vitest、@vitest/coverage-v8、@testing-library/react
3. 创建配置jsdom环境的vitest.config.ts
4. 创建src/test/setup.ts
5. 创建.github/workflows/ci.yml
6. 在package.json中添加测试脚本User: Set up tests for this NestJS API
Claude:
1. Detects NestJS from @nestjs/core dependency
2. Installs vitest, @vitest/coverage-v8, supertest
3. Creates vitest.config.ts with node environment
4. Creates test/setup.ts
5. Creates .github/workflows/ci.yml with MongoDB service
6. Adds test scripts to package.json用户:为这个NestJS API设置测试
Claude:
1. 从@nestjs/core依赖检测到NestJS项目
2. 安装vitest、@vitest/coverage-v8、supertest
3. 创建配置node环境的vitest.config.ts
4. 创建test/setup.ts
5. 创建包含MongoDB服务的.github/workflows/ci.yml
6. 在package.json中添加测试脚本vitest.config.tstsconfig.jsonresolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},vitest.config.tstsconfig.jsonresolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},bun test --coveragebun test --coveragebunx tsc --noEmitbunx tsc --noEmit