Skip to content

fix: generate a cross-platform test command for TS ESM apps - #895

Open
TibJnt wants to merge 1 commit into
fastify:mainfrom
TibJnt:codex/fix-ts-esm-test-windows
Open

fix: generate a cross-platform test command for TS ESM apps#895
TibJnt wants to merge 1 commit into
fastify:mainfrom
TibJnt:codex/fix-ts-esm-test-windows

Conversation

@TibJnt

@TibJnt TibJnt commented Jun 12, 2026

Copy link
Copy Markdown

Summary

  • use cross-env in the generated TypeScript ESM npm test script so the template works on Windows
  • add generator assertions that the template includes cross-env and still preserves the expected test glob

Problem

Issue #835 reports that generated --lang=ts --esm apps emit FASTIFY_AUTOLOAD_TYPESCRIPT=1 node ... in package.json, which breaks on Windows because inline environment variable assignment is shell-specific.

Validation

  • node suite-runner.js "test/generate-typescript.test.js"
  • node suite-runner.js "test/generate-typescript-esm.test.js"

Notes

  • The branch was pushed via the existing SSH fork remote.
  • The repo-level npm test command currently hits an unrelated Node 26 / yargs ESM failure in the existing suite.

Signed-off-by: TibJnt <thibaultjnt@yahoo.fr>

@ilteoood ilteoood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it would be better to avoid using cross-env, considering that has been marked as "finished" almost 6 years ago and is now marked as read-only

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.

2 participants