-
Notifications
You must be signed in to change notification settings - Fork 10
Description
π€ This PR was created by Repo Assist, an automated AI assistant.
Summary
Significantly improves the test suite by adding 24 new unit tests for the PHPCBF class (previously untested) and 6 edge-case tests for findFiles. Total test count grows from 7 β 36.
Changes
extension.js
- Exports
PHPCBFclass (exports.PHPCBF = PHPCBF) so unit tests can instantiate it directly without requiring a VS Code Extension Host.
test/phpcbf.test.js (new)
Tests PHPCBF by injecting a lightweight vscode mock via Module._resolveFilename β no extension host required. Covers:
| Suite | What's tested |
|---|---|
loadSettings |
Default values, config overrides, onsave, standard, debug, tilde (~) expansion in executablePath, re-load on config change |
getArgs |
-lq vs -l flag (debug mode), tmpFileName placement, --standard=(value) presence/absence, argument ordering |
getStandard |
configSearch: false pass-through, null workspace folder, phpcs.xml discovery, .phpcs.xml priority over phpcs.xml, fallback to this.standard, null standard |
test/unit.test.js
Six new edge-case tests for findFiles:
- Empty
namesarray βnull - Empty-string
directory(resolves to parent) β finds file / returns null - Name-array priority: first match wins; falls through to second name when first absent
package.json
Updated test:unit script to run both test files: node --test test/unit.test.js test/phpcbf.test.js
Test Status
β PHPCBF.loadSettings (10 tests)
β PHPCBF.getArgs (7 tests)
β PHPCBF.getStandard (7 tests)
β findFiles (12 tests, up from 7)
tests 36 | pass 36 | fail 0
All tests pass with npm run test:unit.
Generated by Repo Assist Β· β·
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f
Warning
π‘οΈ Protected Files
This was originally intended as a pull request, but the patch modifies protected files: package.json.
These files may affect project dependencies, CI/CD pipelines, or agent behaviour. Please review the changes carefully before creating the pull request.
Click here to create the pull request once you have reviewed the changes
To route changes like this to a review issue instead of blocking, configure protected-files: fallback-to-issue in your workflow configuration.