Skip to content

test: run full test suite in CI, not just smoke tests#11

Open
dmchaledev wants to merge 1 commit into
mainfrom
claude/sleepy-rubin-GzkrA
Open

test: run full test suite in CI, not just smoke tests#11
dmchaledev wants to merge 1 commit into
mainfrom
claude/sleepy-rubin-GzkrA

Conversation

@dmchaledev
Copy link
Copy Markdown
Contributor

Problem

The npm test script only ran test/smoke.test.mjs:

"test": "node --test test/smoke.test.mjs"

That means the 59-test test/calculate.test.mjs suite — 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", but package.json was never actually changed, so the new suite has been silently skipped this whole time.

Before:

# tests 6
# pass 6

Fix

Glob over test/*.test.mjs so npm test runs every test file:

"test": "node --test test/*.test.mjs"

After:

# tests 65
# pass 65

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 --test glob ('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.mjs is expanded by the shell on all three versions, keeping the matrix green.

Verification

$ npm test
# tests 65
# suites 15
# pass 65
# fail 0

https://claude.ai/code/session_01LwFnZPwzoyzna7pPqq2b6R


Generated by Claude Code

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