test: run full test suite in CI, not just smoke tests#11
Open
dmchaledev wants to merge 1 commit into
Open
Conversation
The test script only ran test/smoke.test.mjs (6 tests), so the 59-test calculate.test.mjs suite covering all VM-sizing, timing, cost, and ROI calculation logic was never executed in CI. Glob over test/*.test.mjs so `npm test` runs all 65 tests. Uses shell glob expansion (unquoted) rather than Node's native --test glob, which only exists in Node 21+, to stay compatible with the Node 18/20/22 CI matrix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
npm testscript only rantest/smoke.test.mjs:That means the 59-test
test/calculate.test.mjssuite — which validates all the core VM-sizing, timing, cost, and ROI calculation logic — was never executed by CI. Only the 6 smoke tests ran on every push and PR.This appears to be an oversight: commit
dafee26("fix: strengthen type definitions, add calculation tests (59 new)") describes its test script change as "Updated test script to glob", butpackage.jsonwas never actually changed, so the new suite has been silently skipped this whole time.Before:
Fix
Glob over
test/*.test.mjssonpm testruns every test file:After:
All 65 tests pass (6 smoke + 59 calculation). No production code changes — this only widens what CI exercises.
Why the unquoted glob
I used the unquoted, shell-expanded form rather than Node's native
--testglob ('test/**/*.test.mjs'). Node's built-in glob matching for the test runner only landed in Node 21+, but the CI matrix runs Node 18, 20, and 22. Since npm executes scripts through a shell,test/*.test.mjsis expanded by the shell on all three versions, keeping the matrix green.Verification
https://claude.ai/code/session_01LwFnZPwzoyzna7pPqq2b6R
Generated by Claude Code