Skip to content

test: run full test suite in npm test (was only smoke tests)#13

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

test: run full test suite in npm test (was only smoke tests)#13
dmchaledev wants to merge 1 commit into
mainfrom
claude/sleepy-rubin-exejc

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 meant the 59-test calculate.test.mjs suite — added in #9 specifically to cover the core VM sizing, scan timing, cost, and ROI logic — never actually ran in CI. Every workflow uses npm test:

  • ci.yml (PR + push, Node 18/20/22 matrix)
  • auto-tag.yml (gates the auto-tag on main)
  • effectively the pre-publish gate via the tag → publish.yml chain

So all three checks were green while exercising only 6 smoke assertions and skipping the 59 tests that validate the actual calculations users depend on. A regression in calculate() could ship to npm without any test catching it.

The #9 commit message even claimed "Updated test script to glob", but the script in main still points at the single smoke file — so this restores the intended behavior.

Fix

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

A shell-expanded glob (npm runs scripts via sh) keeps this portable across the supported Node 18/20/22 matrix — native test-runner globbing wasn't added until Node 21, so a quoted glob would silently match nothing on 18/20.

Verification

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

No source or test changes — only the npm script. All 65 tests pass.

https://claude.ai/code/session_01KysAzJtSKywS8tMzTbs3SY


Generated by Claude Code

The npm test script only ran test/smoke.test.mjs (6 tests), so the
59-test calculate.test.mjs suite covering core VM sizing, timing, cost,
and ROI logic never executed in CI. Glob all *.test.mjs files so the
full suite (65 tests) runs on every push, PR, and pre-publish check.

Shell-expanded glob keeps this portable across the supported Node
18/20/22 matrix (npm runs scripts via sh).
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