Skip to content

Fix template test discovery without node:fs globSync#30

Closed
GsCommand wants to merge 1 commit intomainfrom
codex/fix-ci-for-pr-#29
Closed

Fix template test discovery without node:fs globSync#30
GsCommand wants to merge 1 commit intomainfrom
codex/fix-ci-for-pr-#29

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • The test runner attempted to import globSync from node:fs, which isn't exported and caused a SyntaxError during CI test discovery.
  • The intent is to reliably discover optional template test suites and skip missing suites without touching src/index.ts.

Description

  • Replaced glob-style patterns with explicit suite directories and a root base URL for resolution in typescript-sdk/scripts/template-tests.mjs.
  • Added a small findTestFiles helper that uses existsSync and readdirSync to check for directory existence and collect files ending with *.test.mjs.
  • The script now skips missing or empty suites and invokes node --test with explicit file paths for each discovered suite.

Testing

  • Ran npm run typecheck in typescript-sdk, which failed due to pre-existing src/index.ts type errors unrelated to this change. (failed)
  • Ran npm run build in typescript-sdk, which failed at the DTS generation stage for the same pre-existing type errors. (failed)
  • Ran npm run test:unit in typescript-sdk, which failed because the build step failed first. (failed)
  • Ran node scripts/template-tests.mjs directly, which exercised the new discovery logic and ran template tests (7 passed, 2 existing runtime tests failed), demonstrating discovery now works without using globSync. (partial pass)

Codex Task

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