Skip to content

test: run full test suite in npm test, not just smoke tests#18

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

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

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Problem

The comprehensive test/calculate.test.mjs suite — 59 tests covering VM sizing, timing, cost, ROI, and recommendation logic — was added in dafee26, whose commit message stated it "Updated test script to glob." But the test script in package.json was never actually updated; it still ran only test/smoke.test.mjs:

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

As a result, npm test — and therefore CI (.github/workflows/ci.yml runs npm test) — only executed 6 smoke tests. The 59 calculation tests, the ones that actually validate the calculator's math, have never run in CI. A regression in the core sizing/cost engine would pass green.

Fix

Switch to Node's built-in test-file auto-discovery:

"test": "node --test"

node --test with no path argument discovers every *.test.mjs under test/ on Node 18+ (the package's declared floor, and all three versions in the CI matrix). This avoids shell-glob portability issues and automatically picks up any future test files.

Verification

Before After
npm test 6 tests 65 tests (9 suites)
# tests 65
# suites 9
# pass 65
# fail 0

All tests pass. Zero-dependency, no devDeps added — still uses the built-in node:test runner.

https://claude.ai/code/session_01PPx1tAHPfaY1BasyRLtUz6


Generated by Claude Code

The calculate.test.mjs suite (59 tests covering VM sizing, timing, costs,
ROI, and recommendations) was added in dafee26, but the npm test script
still pointed only at smoke.test.mjs, so those tests never ran in CI.

Switch to node --test auto-discovery, which finds every *.test.mjs file in
test/ on Node 18+. npm test now runs all 65 tests (was 6).
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