Describe the bug
Having a beforeAll outside any describes leads to the test runner reporting an incorrect number of failed steps: one more than the actual number of tests that have failed.
Steps to Reproduce
deno test the script below:
import { assert } from '@std/assert';
import { describe, test, beforeAll } from '@std/testing/bdd';
beforeAll(() => {
// A `beforeAll` outside the `describe`, even empty, increases the number of failed tests by 1
});
describe('the describe', () => {
test('test 1', () => {
assert(Math.random() < 0.0001);
});
test('test 2', () => {
assert(Math.random() === 0.123456);
});
});
The output will include FAILED | 0 passed | 1 failed (3 steps).
Expected behavior
The final test message should be FAILED | 0 passed | 1 failed (2 steps).
Environment
- OS: Ubuntu 24.04
- deno version: 2.7.7
- jsr:@std/expect: 1.0.18
- jsr:@std/testing: 1.0.17
Describe the bug
Having a
beforeAlloutside anydescribes leads to the test runner reporting an incorrect number of failed steps: one more than the actual number of tests that have failed.Steps to Reproduce
deno testthe script below:The output will include
FAILED | 0 passed | 1 failed (3 steps).Expected behavior
The final test message should be
FAILED | 0 passed | 1 failed (2 steps).Environment