Skip to content

fix: skip production build before CommonJS TypeScript tests - #933

Open
pillaiajay31 wants to merge 3 commits into
fastify:mainfrom
pillaiajay31:fix/640-typescript-test-build
Open

pillaiajay31 wants to merge 3 commits into
fastify:mainfrom
pillaiajay31:fix/640-typescript-test-build

Conversation

@pillaiajay31

@pillaiajay31 pillaiajay31 commented Nov 11, 2026 •

Copy link
Copy Markdown

Remove the redundant production build before testing generated CommonJS TypeScript apps. Keep source type checking and tests through ts-node, and preserve the independent production build.

Update the CommonJS template for TypeScript 6 with explicit Node types and rootDir settings, remove the unused baseUrl, update generator assertions, and document test/build behavior.

Fixes #640.

Validation on Windows with Node.js v24.22.1 and TypeScript 6.0.3:

  • Generated app: 4 tests passed; dist absent after tests; independent build succeeded and produced dist/app.js.
  • Both TypeScript generator suites: 12 tests passed. All four template suites: 12 tests passed. Lint on the changed generator test passed.
  • A deliberate source type error correctly stopped npm test with exit 2.
  • npm run test and npm run benchmark --if-present returned exit 0, but the Windows test script stopped after xcopy without executing tests. No benchmark script is defined.
  • Running the intended CLI suite directly exited 1: 202 passed, 15 failed, 7 skipped. Failures include Windows path separators and EBUSY errors removing temporary directories; coverage fell below the required 100%. Subsequent CLI TypeScript, CLI ESM, and tstyche commands were not reached. The watch relative-path failure also reproduces in the original validation checkout.

Checklist

Remove the production build step from the generated CommonJS TypeScript test script. The test helper loads src/app.ts directly through ts-node, and the test TypeScript configuration already checks the application source without emitting files.

Signed-off-by: Ajay Pillai <pillaiajay42@gmail.com>
@pillaiajay31 pillaiajay31 changed the title Fix/640 typescript test build fix: skip production build before CommonJS TypeScript tests Nov 11, 2026
Signed-off-by: AJAY PILLAI <pillaiajay42@gmail.com>
Signed-off-by: AJAY PILLAI <pillaiajay42@gmail.com>
@pillaiajay31
pillaiajay31 force-pushed the fix/640-typescript-test-build branch from e2a27b7 to c0781bc Compare November 11, 2026 05:41

This branch has not been deployed

No deployments
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.

Unnecessary ts build step while "npm run test". Ts generated project.

1 participant