-
Notifications
You must be signed in to change notification settings - Fork 68
Description
Description
When working with a monorepo or a project where Laravel is in a subdirectory, the extension discovers and lists tests from the vendor/ directory, which pollutes the Test Explorer with hundreds of irrelevant tests from third-party packages.
Current Behavior
The extension scans all *Test.php files in the workspace, including those inside vendor/. There is no way to exclude specific directories from test discovery.
Expected Behavior
Provide a configuration option to exclude directories from test discovery, similar to the old phpunit.files option that existed in v2.x.
Suggested Solution
Add a new setting like:
json{
"phpunit.exclude": ["**/vendor/**"]
}
Or bring back the phpunit.files option:
json{
"phpunit.files": "laravel/tests/**/*Test.php"
}
Workarounds Attempted (None Worked)
files.exclude: Does not affect test discoverysearch.exclude: Does not affect test discoveryfiles.watcherExclude: Does not affect test discoveryphpunit.files: Option no longer exists in v3.xphpunit.paths: Only for local/remote path mapping, not filtering
Environment
- Extension version: 3.7.10
- VS Code version: 1.96
- OS: macOS
Project Structure
/my-project
├── devbox.json
├── laravel/
│ ├── vendor/ ← Tests here should be ignored
│ ├── tests/ ← Only these tests should be discovered
│ │ ├── Unit/
│ │ └── Feature/
│ └── phpunit.xml
└── other-folders/
Current Configuration
json{
"phpunit.command": "devbox",
"phpunit.phpunit": "run test:laravel",
"phpunit.args": []
}
Additional Context
The only current workaround is to open the laravel/ subdirectory directly in VS Code, which is not ideal for monorepo workflows where you need access to other folders.
Thank you for this great extension!