How to make "composer test" your default test runner
Automated TestingTo get `composer test` to work in the command line and here are two of my preferred boilerplates:
In `composer.json`, "scripts" section, add this:
"scripts": {
...
"test": "vendor/bin/pest"
},or this:
"scripts": {
...
"test": "vendor/bin/pest --parallel"
},Here is a slightly more verbose `composer.json` file showing you where the command was inserted:
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan filament:upgrade"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"test": "vendor/bin/pest --parallel",
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
]
}