Skip to content

fix(ci): use is-ci-cli binary so npm test actually runs Jest#263

Merged
arb merged 1 commit into
masterfrom
fix/is-ci-cli-binary
Apr 30, 2026
Merged

fix(ci): use is-ci-cli binary so npm test actually runs Jest#263
arb merged 1 commit into
masterfrom
fix/is-ci-cli-binary

Conversation

@arb

@arb arb commented Apr 30, 2026

Copy link
Copy Markdown
Owner

What and why

Surprising bug: npm test has been silently green-without-tests in CI for some time. Across every matrix cell on master (ae850d0), the test step prints > is-ci 'test:ci' 'test:local' and exits in ~0.1s without ever invoking Jest. No Tests: N passed line, no coverage written.

Root cause

Two installed packages publish a binary called is-ci:

  1. The standalone is-ci package, pulled in transitively. Its bin is literally:

    process.exit(require('./') ? 0 : 1)

    It exits 0 in CI, 1 otherwise. Arguments are ignored.

  2. Our is-ci-cli devDep, which exposes both is-ci and is-ci-cli binaries pointing at the same cli.js (the one that actually spawns the named npm script).

When both are installed, node_modules/.bin/is-ci wins for whichever package was linked last. In this repo it's the standalone package:

node_modules/.bin/is-ci -> ../is-ci/bin.js

So "test": "is-ci 'test:ci' 'test:local'" invoked the dummy bin and silently succeeded. The is-ci-cli README documents the correct invocation as the unambiguous binary is-ci-cli -- using that name avoids the collision entirely.

The fix

One word in package.json:

-    "test": "is-ci 'test:ci' 'test:local'",
+    "test": "is-ci-cli test:ci test:local",

(Quotes also dropped to match the package's documented usage; no spaces in the script names.)

Local verification

$ rm -rf coverage && CI=true npm test
> is-ci-cli test:ci test:local
> node --experimental-vm-modules node_modules/.bin/jest --ci
...
All files          |     100 |      100 |     100 |     100 |
Test Suites: 2 passed, 2 total
Tests:       62 passed, 62 total
$ ls -la coverage/lcov.info
-rw-r--r-- 1 ... 2259 ... coverage/lcov.info

Related

Unblocks #262 (codecov-action migration) -- once both merge, the new coverage job will actually have an lcov.info file to upload.

The `is-ci` binary in node_modules/.bin/ was resolving to the standalone
`is-ci` package (a transitive dep), whose bin is just
`process.exit(require('./') ? 0 : 1)` -- it exits 0 in CI without
running anything. As a result `npm test` has been silently green for
some time across every matrix cell without invoking Jest at all.

The `is-ci-cli` devDep exposes both `is-ci` and `is-ci-cli` binaries,
but loses the bin-name collision with the standalone package depending
on install order. Calling the unique `is-ci-cli` name avoids the
collision and matches the package's documented usage.

Made-with: Cursor
@arb arb marked this pull request as ready for review April 30, 2026 20:46
@arb arb merged commit 0a0a838 into master Apr 30, 2026
8 checks passed
@arb arb added this to the 16.0.0 milestone Apr 30, 2026
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