Skip to content

Discover TypeScript test suites automatically - #515

Merged
robgruen merged 1 commit into
mainfrom
dev/robgruen/test-discovery-hardening
Nov 3, 2026
Merged

robgruen merged 1 commit into
mainfrom
dev/robgruen/test-discovery-hardening

Conversation

@robgruen

@robgruen robgruen commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Remove the manually maintained TypeScript suite list so newly added tests cannot compile without executing. This hardens the gap found in the original #513 coding-pilot candidate; #505 already makes Node CI invoke npm test.

  • Keep the existing library build and test-compilation stages unchanged, then use quoted native recursive globs for out/**/*.test.js and tests/**/*.test.mjs.
  • Add two offline regressions derived from the actual package test invocation. Four new flat/nested compiled-JS and runtime-MJS callbacks must execute; helper files and uncompiled TypeScript must not run. A newly discovered failing suite must produce the expected failure and nonzero exit status.
  • Document the supported test locations and naming without adding a custom runner or dependency. Documentation links follow the published README's existing GitHub-link convention.

Verification

  • Both new regressions failed with the old explicit selector.

  • Both pass on Node 22.23.4, 24.22.1, and 26.12.1.

  • The actual configured npm test on pinned Node 24.22.1 builds, type-checks, and passes all 243 tests, with no failures or skips: the previous 241 plus both discovery regressions. Its package-consumer/workspace-build check also passes.

  • git diff --check passes.

  • The first full invocation failed only because the fresh worktree lacked tsc; restored the unchanged locked workspace dependencies from the existing offline cache with install scripts disabled. Dependency versions and lockfiles are unchanged.

  • All 12 CI checks pass at ddab45bba267a30fa0d3023f8f7a638872e92b0a. The Node CI logs were checked: Node 22.23.4, 24.22.1, and 26.12.1 each actually ran and passed all 243 tests, including both discovery regressions.

Scope

Only the TypeScript test script, one regression file, and related README changed. No runtime/API, engine, CI-matrix, workflow-permission, budget, or coding-pilot activation changes. No coding/drafting run, issue closure, or merge. Existing contributor work and the historical automated publication evidence remain unchanged.

Keep the existing build and test-compilation stages, then use quoted native recursive globs for compiled JavaScript and runtime MJS suites. Regressions prove new flat and nested suites execute, helpers and raw TypeScript are ignored, and new test failures propagate. Document the supported test locations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 07:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the automatic test-discovery change.

No open issues 🎉

What changed in this PR

This PR replaces TypeScript’s manually maintained test-suite list with automatic discovery, closing the gap where new tests could compile without running. It complements the existing CI invocation of npm test without changing the build stages or runtime APIs.

Changes:

  • Use quoted recursive Node test patterns for compiled JavaScript and runtime MJS suites.
  • Add offline regressions for flat and nested discovery, helper-file exclusion, and failure propagation.
  • Document supported test locations and naming conventions.
File Description
typescript/​tests/​test-discovery.test.mjs Adds discovery and failure-propagation regression tests.
typescript/​README.md Explains automatic discovery and where to add tests.
typescript/​package.json Replaces explicit suite paths with recursive patterns.

Review effort: Balanced

@robgruen
robgruen merged commit 0aa10e8 into main Nov 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants