generated from voxpelli/node-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Looks like for some reason this package swallows errors if the experimental mocking is enabled.
I was setting up a basic test to play around with mocking and made a failing test like this:
import assert from 'node:assert';
import test from 'node:test';
test('greet', async (t) => {
t.mock.module('../some-module.js', {
namedExports: {
greet() {
return `Goodbye, World!`;
},
},
});
const { greet } = await import('../some-module.js');
assert.equal(greet(), 'Hello, World!');
});
and when I ran it via:
node --test --experimental-test-module-mocks --test-reporter=@voxpelli/node-test-pretty-reporter ./greet.test.js
the only thing it emitted was this:
ℹ tests 1
ℹ suites 0
ℹ pass 0
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 214.166458
Running with the default node test reporter shows errors correctly, though.
Metadata
Metadata
Assignees
Labels
No labels