voxpelli / node-test-pretty-reporter

Reporter for node:test that supports colorful diffs etc
MIT License
10 stars 2 forks source link

Errors are not reported if assert is called in a test outside a suite. #27

Open Ericnr opened 2 weeks ago

Ericnr commented 2 weeks ago

I get the following report with no error logging

ℹ tests 1
ℹ suites 0
ℹ pass 0
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 198.50575

When I run a simple test

import test, { suite } from 'node:test';

test('the test', () => {
  assert(false);
});

Errors are reported if assert is called inside a suite or inside a subtest

import test, { suite } from 'node:test';
// both work
test('the test', () => {
  test('a subtest', () => {
    assert(false);
  });
});

suite('the suite', () => {
  test('a test', () => {
    assert(false);
  });
});

I'd expect errors to be logged in any case

voxpelli commented 2 weeks ago

Is it working with other reporters?