denoland / denoland/std

@std/testing/bdd: Skipped inner describe should be inside the Outer describe and indented

Open
#6,354 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

When a nested `describe` is skipped, its `ignored` line is output above and outside its parent `describe`, and without an indentation.

**Steps to Reproduce**

**deno-describe-skip-order.test.ts**:
```ts
import { describe, test } from 'jsr:@std/testing/bdd';

describe('Outer describe', () => {
describe.skip('Skipped inner describe should be inside the Outer describe and at the same indent level as the Executed one', () => {
});
describe('Executed inner describe', () => {
test.skip('Skipped test is correctly indented at the same level as the Executed test', () => {
});

test('Executed test', () => {
});
});
});
```

```sh
$ deno test deno-describe-skip-order.test.ts
Check ~/deno-bugs/deno-describe-skip-order.test.ts
running 2 tests from ./deno-describe-skip-order.test.ts
Skipped inner describe should be inside the Outer describe and at the same indent level as the Executed one ... ignored (0ms)
Outer describe ...
Executed inner describe ...
Skipped test is correctly indented at the same level as the Executed test ... ignored (0ms)
Executed test ... ok (1ms)
Executed inner describe ... ok (2ms)
Outer describe ... ok (3ms)
```

**Expected behavior**

The message "Skipped inner describe should be inside the Outer describe and at the same indent level as the Executed one ... ignored" should have been placed inside "Outer describe ...", and indented with two spaces.

**Environment**

- OS: Fedora 38
- deno version: 2.1.4
- std version: jsr:@std/testing@^1.0.9

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.