Skip to content

Fix TypeScript template test discovery for optional runtime suite#39

Closed
GsCommand wants to merge 1 commit intomainfrom
codex/fix-typescript-template-tests-runtime-errors
Closed

Fix TypeScript template test discovery for optional runtime suite#39
GsCommand wants to merge 1 commit intomainfrom
codex/fix-typescript-template-tests-runtime-errors

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • The template test runner passed wildcard globs directly to node --test, which causes Node to error when a glob matches nothing; the goal is to avoid failing CI in that case.
  • The runtime/tests suite should be optional for TypeScript template execution while typescript-sdk/tests must remain required.

Description

  • Replace wildcard-based invocation with explicit discovery using existsSync, readdirSync, path, and fileURLToPath in typescript-sdk/scripts/template-tests.mjs.
  • Represent suites as objects { dir, optional } and treat runtime/tests as optional and typescript-sdk/tests as required.
  • Discover *.test.mjs files per-suite, skip optional suites when the directory is missing or empty, and fail fast when required suites or files are missing.
  • Run each discovered test file individually via node --test <file> and exit with the first non-zero status.

Testing

  • Ran cd typescript-sdk && npm run typecheck && npm run build && npm run test:unit; the run failed due to pre-existing TypeScript errors in src/index.ts, unrelated to this script change.
  • Ran cd python-sdk && python -m ruff check . && python -m mypy commandlayer && python -m pytest tests/ -v; the run failed due to existing Python lint/type issues unrelated to this change.
  • Ran node scripts/parity-check.mjs; this failed because typescript-sdk/dist/index.cjs was missing when the TS build failed (expected given the TypeScript errors).
  • Executed node typescript-sdk/scripts/template-tests.mjs to validate discovery and skipping behavior; the runner now skips missing optional suites and executes discovered files, but the runtime tests that import the built TS package fail when the package is not built (as observed above).

Codex Task

GsCommand added a commit that referenced this pull request Apr 24, 2026
…r-#38

Reapply PR #38 TypeScript/Python parity fixes and add PR #39 template-suite discovery
@GsCommand GsCommand closed this Apr 24, 2026
@GsCommand GsCommand deleted the codex/fix-typescript-template-tests-runtime-errors branch April 24, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant