Skip to content

Nest test/it calls under a single describe label instead of repeating the describe label for each test #3342

Open
@jakeboone02

Description

What is the problem this feature would solve?

bun test currently repeats the describe label for each test/it call. Take the following test file as an example:

describe("test group 1", () => {
  it("does thing 0", () => { expect(0).toBe(0); });
  it("does thing 1", () => { expect(1).toBe(1); });
  it("does thing 2", () => { expect(2).toBe(2); });
  it("does thing 3", () => { expect(3).toBe(3); });
  it("does thing 4", () => { expect(4).toBe(4); });
});

describe("test group 2", () => {
  it("does thing 5", () => { expect(5).toBe(5); });
  it("does thing 6", () => { expect(6).toBe(6); });
  it("does thing 7", () => { expect(7).toBe(7); });
  it("does thing 8", () => { expect(8).toBe(8); });
  it("does thing 9", () => { expect(9).toBe(9); });
});

This produces the following output:

image

What is the feature you are proposing to solve the problem?

I would prefer a more concise output like Jest, where the describe label is only printed once and the test/it labels are nested beneath it. I believe this is not just cleaner, but also clearer visually.

Here is Jest's output for the same test file:

image

What alternatives have you considered?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bun:testSomething related to the `bun test` runnerenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions