test

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Test

测试

Run tests with coverage reporting. This skill auto-detects test frameworks in the project.
运行带覆盖率报告的测试。该技能会自动检测项目中的测试框架。

Primary Command

主要命令

  • uv run lintro tst
    - Run tests via lintro (handles multiple frameworks)
  • uv run lintro tst
    - 通过lintro运行测试(支持多框架)

Framework Detection

框架检测

When lintro is unavailable or you need to run specific test types, detect frameworks by checking for:
FrameworkConfig FilesTest PatternsRun Command
Vitest
vitest.config.ts
*.test.ts
,
*.spec.ts
bun test
or
bunx vitest
Jest
jest.config.js
*.test.js
,
*.spec.js
bun test
or
bunx jest
Playwright
playwright.config.ts
e2e/*.spec.ts
bun run e2e
or
bunx playwright test
RSpec
.rspec
,
Gemfile
spec/*_spec.rb
bundle exec rspec
pytest
pytest.ini
,
pyproject.toml
test_*.py
,
*_test.py
uv run pytest
BATS
tests/bats/
,
tests/helpers/
*.bats
bats --recursive tests/bats/
Go
go.mod
*_test.go
go test ./...
Rust
Cargo.toml
#[test]
functions
cargo test
当lintro不可用或需要运行特定类型的测试时,可通过检查以下内容检测框架:
框架配置文件测试文件模式运行命令
Vitest
vitest.config.ts
*.test.ts
,
*.spec.ts
bun test
bunx vitest
Jest
jest.config.js
*.test.js
,
*.spec.js
bun test
bunx jest
Playwright
playwright.config.ts
e2e/*.spec.ts
bun run e2e
bunx playwright test
RSpec
.rspec
,
Gemfile
spec/*_spec.rb
bundle exec rspec
pytest
pytest.ini
,
pyproject.toml
test_*.py
,
*_test.py
uv run pytest
BATS
tests/bats/
,
tests/helpers/
*.bats
bats --recursive tests/bats/
Go
go.mod
*_test.go
go test ./...
Rust
Cargo.toml
#[test]
函数
cargo test

Rules

规则

  • Check
    package.json
    scripts for project-specific test commands
  • For shell tests, follow the
    test-shell
    skill for detailed BATS guidance
  • Run tests with coverage enabled and include a coverage report in every test run (this skill owns the coverage policy)
  • 检查
    package.json
    脚本获取项目特定的测试命令
  • 对于Shell测试,请遵循
    test-shell
    技能获取详细的BATS指导
  • 运行测试时启用覆盖率,并在每次测试运行中包含覆盖率报告(本技能负责覆盖率策略)

Usage

使用方法

When asked to run tests:
  1. Try lintro first:
    uv run lintro tst
  2. If lintro unavailable or specific tests needed:
    • Check for config files to detect frameworks
    • Check
      package.json
      for test scripts
    • Run the appropriate command for each framework
  3. Review coverage reports
  4. Ensure test coverage for new/modified code
当需要运行测试时:
  1. 优先尝试lintro
    uv run lintro tst
  2. 如果lintro不可用或需要运行特定测试
    • 检查配置文件以检测框架
    • 检查
      package.json
      中的测试脚本
    • 为每个框架运行相应的命令
  3. 查看覆盖率报告
  4. 确保新增/修改代码的测试覆盖率

Writing Tests

编写测试

For how to write tests, delegate to the appropriate skill:
Stack / toolSkill
Python (pytest)
stand-py
TypeScript/JavaScript (Vitest/Jest)
stand-ts
Rust (
cargo test
)
stand-rust
Shell (BATS)
test-shell
Playwright E2E
test-ui
Playwright API
test-api
For other frameworks (RSpec, Go), follow project conventions and the patterns detected above.
关于如何编写测试,请参考对应技能:
技术栈/工具技能名称
Python (pytest)
stand-py
TypeScript/JavaScript (Vitest/Jest)
stand-ts
Rust (
cargo test
)
stand-rust
Shell (BATS)
test-shell
Playwright E2E
test-ui
Playwright API
test-api
对于其他框架(RSpec、Go),请遵循项目约定和上述检测到的模式。