feat(scripts): filter test:backend by test name#257
Conversation
- Bare args become a FullyQualifiedName filter (npm run test:backend -- MyTestClass) - Args starting with "-" pass through to dotnet test verbatim - Disable no-implicit-globals for scripts/**; it is incompatible with the folder's top-level-function CommonJS style
- Merge the duplicated JS/C# O(n^2) rules into one entry - Compress the commit-message and design-system guidance - Fold the Security section into C# Standards - Drop stale Windows shell hints; keep the CRLF rule
Bundle ReportBundle size has no change ✅ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #257 +/- ##
=======================================
Coverage 45.29% 45.29%
=======================================
Files 897 897
Lines 51929 51929
Branches 4879 4879
=======================================
Hits 23522 23522
Misses 27803 27803
Partials 604 604
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
Pull request overview
This PR improves the developer experience of running backend tests by allowing npm run test:backend -- <pattern> to run only matching tests (via dotnet test --filter FullyQualifiedName~...), while still allowing full dotnet test argument passthrough when flags are provided. It also updates contributor docs and adjusts lint configuration to fit the scripts folder’s CommonJS style.
Changes:
- Add CLI argument parsing to
scripts/test-dotnet.jsto convert bare positional args into a--filter FullyQualifiedName~...expression (OR-joined with|), and passthrough when any arg starts with-. - Document single-test usage for backend/frontend testing and tighten CLAUDE.md guidance.
- Disable
no-implicit-globalsforscripts/**in.oxlintrc.jsonto avoid incompatible linting with the scripts’ style.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/test-dotnet.js | Builds dotnet test args from npm CLI input to support test-name filtering and passthrough flags. |
| CLAUDE.md | Documents single-test commands and consolidates/updates engineering guidelines. |
| .oxlintrc.json | Updates scripts override to disable no-implicit-globals for CommonJS script patterns. |
Summary
npm run test:backend -- <TestClassName>now runs just the matching tests instead of the whole suite, mirroring the frontend'stest:frontend -- <file-pattern>UX.--filter FullyQualifiedName~<pattern>expression (multiple patterns join with|); any arg starting with-passes through todotnet testverbatim, so full filter expressions still work.Lint config
no-implicit-globals: offto the existingscripts/**override in.oxlintrc.json. That rule is incompatible with the folder's plain-CommonJS top-level-function style (every script trips it); it only surfaced now because the pre-commit hook re-lints staged files andtest-dotnet.jsbecame staged.Testing
npm run test:backend -- HtmlToTextConverterTests→ ran exactly that class's 10 tests (~2s).npm run test:backend -- --filter "FullyQualifiedName~...Convert_EmptyHtml_ReturnsEmptyString"→ ran exactly 1 test, confirming verbatim passthrough.npm run test:backend(no args) → unchanged, runs the full suite.