Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ericnr opened this issue Aug 26, 2024 · 1 comment
Open

Comments

@Ericnr
Copy link

Ericnr commented Aug 26, 2024

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
Copy link
Owner

Is it working with other reporters?

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

No branches or pull requests

2 participants