Skip to content

Fix npm test running 0 tests, add CI#723

Open
rar-file wants to merge 1 commit into
Leonidas-from-XIV:masterfrom
rar-file:fix-test-runner
Open

Fix npm test running 0 tests, add CI#723
rar-file wants to merge 1 commit into
Leonidas-from-XIV:masterfrom
rar-file:fix-test-runner

Conversation

@rar-file

@rar-file rar-file commented Jun 7, 2026

Copy link
Copy Markdown

On a fresh checkout, npm test currently prints "All of 0 tests passed. Yeah!" — the suite does not run at all.

Root cause: zap only picks up .test.coffee files when require('coffee-script/register') succeeds. b856cb8 switched the devDependency to the renamed coffeescript package, so a fresh npm install leaves zap without a compiler and it silently falls back to *.test.js (of which there are none).

The fix is a one-liner: install coffeescript under its legacy name with an npm alias ("coffee-script": "npm:coffeescript@>=1.10.0 <2"). Same package, same version range, and the coffee/cake binaries are unaffected. With this, all 99 tests run and pass.

Since this shipped in two releases without anyone noticing, I also added a minimal GitHub Actions workflow (Node 18/20/22/24, npm ci && npm test) so a regression like this cannot stay silent again.

Overlaps partially with #686, which gets CI working by precompiling the tests to JS via extra cake tasks; this PR instead fixes npm test itself, so the workflow stays a plain npm ci && npm test.

The zap test runner loads CoffeeScript test files only when it can
require('coffee-script/register'). Since b856cb8 the devDependency is
the renamed 'coffeescript' package, so on a fresh npm install zap finds
no compiler, silently falls back to *.test.js, and reports 'All of 0
tests passed'.

Install coffeescript under its legacy 'coffee-script' name via an npm
alias so zap resolves it again. The coffee/cake binaries are unchanged.
All 99 tests now run and pass.

Also add a GitHub Actions workflow running the suite on Node 18-24 so
a silent regression like this gets caught.
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.

1 participant