Linux command
pest 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run all tests
pest
Run specific test
pest --filter [test_name]
Run with coverage
pest --coverage
Run in parallel
pest --parallel
Stop on first failure
pest --bail
Watch for changes
pest --watch
Show test list
pest --list-tests
Run specific file
pest [tests/Feature/ExampleTest.php]
说明
pest is an elegant PHP testing framework. It provides a clean, expressive syntax built on PHPUnit. Tests use a describe/it syntax similar to JavaScript testing frameworks. Expectations chain fluently for readable assertions. Parallel execution speeds up large test suites. Processes are distributed across available cores. Coverage reports show code coverage percentage. HTML and other formats are available. Watch mode reruns tests on file changes. Failed tests rerun first for faster feedback.
参数
- --filter _PATTERN_
- Filter tests by name.
- --parallel
- Run in parallel.
- --coverage
- Generate coverage report.
- --bail
- Stop on first failure.
- --watch
- Watch mode.
- --list-tests
- List available tests.
- --min _PERCENT_
- Minimum coverage.
- --group _NAME_
- Run test group.
- --exclude-group _NAME_
- Exclude test group.
- -v, --verbose
- Verbose output.
FAQ
What is the pest command used for?
pest is an elegant PHP testing framework. It provides a clean, expressive syntax built on PHPUnit. Tests use a describe/it syntax similar to JavaScript testing frameworks. Expectations chain fluently for readable assertions. Parallel execution speeds up large test suites. Processes are distributed across available cores. Coverage reports show code coverage percentage. HTML and other formats are available. Watch mode reruns tests on file changes. Failed tests rerun first for faster feedback.
How do I run a basic pest example?
Run `pest` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --filter _PATTERN_ do in pest?
Filter tests by name.