Repository navigation
fix: make generated TypeScript ESM tests cross-platform - #919
GhaythBenAbid wants to merge 2 commits into
Conversation
|
Tested locally on Node 24 (Windows). Moving One small cross-platform fix is needed in On Windows, the walker yields backslash paths like const copiedFileCount = Object.keys(expected).filter(file => file !== '/package.json').lengthBecause Normalizing separators or checking const copiedFileCount = Object.keys(expected).filter(file => !file.endsWith('package.json')).lengthWith that adjustment, all 6 tests in |
On Windows the walker yields keys like `\package.json`, so comparing
against `/package.json` never matched and the planned assertion count
was one too high ("plan expected 42 assertions but received 41").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6fcb258 to
d7f3270
Compare
|
Thanks for testing on Windows, @SameRainbows. Good catch. Fixed in d7f3270 by normalizing path separators before the comparison ( I also rebased onto the latest |
Fixes #835
The generated TypeScript ESM test command currently uses POSIX inline environment-variable syntax, which fails in Windows Command Prompt. It also uses the deprecated Node loader flag.
This change adds a small preload module that sets FASTIFY_AUTOLOAD_TYPESCRIPT and registers ts-node through node:module. The generated test script loads it with the cross-platform --import option.
The ESM generator test now exercises the actual app-ts-esm template, including the preload module.
Verification: