You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
errors thrown in describe() do not set non-zero exitCode (and do not fail CI) #58687
E.g. assume some lib uses node:test for tests
And has some preparation steps in descripe, e.g. a function call or a library import. Or test data creation.
Or e.g. mock.module( call (which Node.js tests do:)
That was not expected to throw
And then as a result of or a regression in that lib that code begins to throw (e.g. a file gets renamed and mock.module can't find it anymore)
But node:test in CI will mark it as passing because if describe() itself throws and no tests are run, that counts as passing
Even though is reported as failing in the logs.
@JakobJingleheimer There is mistype in test_. Which demonstrates this just fine once you run it?
The test fails but is reported as passing.
Tests should not be marked as passing when the user makes a mistype in test(.
Any error during describe( reproduces it
I'm unsure how adding more examples (of various errors that could happen during describe() under attempted normal usage) to the demo would help if the issue should be clear as is
Activity
fix: ensure we set non-0 exit code on errors node:test describe()
ChALkeR commentedon Feb 26, 2026
cc @nodejs/test_runner ?
JakobJingleheimer commentedon Feb 26, 2026
Is this perhaps caused by mixing
testwithdescribe? I think I've not tried to do that; I'm not sure it's supported.ChALkeR commentedon Feb 26, 2026
@JakobJingleheimer No, this assumes legitimate usecase.
E.g. assume some lib uses
node:testfor testsAnd has some preparation steps in
descripe, e.g. a function call or a library import. Or test data creation.Or e.g.
mock.module(call (which Node.js tests do:)That was not expected to throw
And then as a result of or a regression in that lib that code begins to throw (e.g. a file gets renamed and
mock.modulecan't find it anymore)But
node:testin CI will mark it as passing because ifdescribe()itself throws and no tests are run, that counts as passingEven though is reported as failing in the logs.
JakobJingleheimer commentedon Feb 26, 2026
There is no preparation in the reproduction in your OP. Could you please update your OP to reflect what you just described.
ChALkeR commentedon Feb 26, 2026
@JakobJingleheimer There is mistype in
test_. Which demonstrates this just fine once you run it?The test fails but is reported as passing.
Tests should not be marked as passing when the user makes a mistype in
test(.Any error during
describe(reproduces itI'm unsure how adding more examples (of various errors that could happen during describe() under attempted normal usage) to the demo would help if the issue should be clear as is