| name | testing-unit |
| description | Unit testing across languages -- Jest, Vitest, pytest, Go test, Rust test, coverage, and watch mode. |
| metadata | {"thinkfleetbot":{"emoji":"🧪","requires":{"bins":["npx","node"]}}} |
Unit Testing
Run and manage unit tests across multiple languages and frameworks.
Run Jest tests
npx jest
npx jest path/to/file.test.ts
npx jest --testPathPattern="auth"
npx jest -t "should authenticate user"
npx jest --verbose
Run Vitest
npx vitest run
npx vitest run path/to/file.test.ts
npx vitest run --reporter=verbose -t "login"
npx vitest --ui
Run pytest
python -m pytest
python -m pytest tests/test_auth.py
python -m pytest tests/test_auth.py::test_login -v
python -m pytest -k "login or signup"
python -m pytest -v --tb=short
Run Go tests
go test ./...
go test ./pkg/auth/...
go test -run TestLogin ./pkg/auth/
go test -v ./...
Run Rust tests
cargo test
cargo test test_login
cargo test --lib auth
cargo test -- --nocapture
Generate test file
Run with coverage
npx jest --coverage
npx vitest run --coverage
python -m pytest --cov=src --cov-report=html
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
cargo llvm-cov --html
Watch mode
npx jest --watch
npx vitest
ptw -- -v
watchexec -e go -- go test ./...