bun
bun copied to clipboard
Expected behavior of `describe` inside `describe.only`
What version of Bun is running?
1.0.26+c75e768a6
What platform is your computer?
Darwin 21.6.0 x86_64 i386
What steps can reproduce the bug?
When describe
is nested inside of describe.only
no test execute.
This is regardless of bun test
or bun test --only
.
Minimum Reproducible Example
index.ts
export function sum(a: number, b: number) { return a + b; };
index.test.ts
import { sum } from "./index";
describe("Sum Only", () => {
test("sum", () => {
expect(sum, 4, 5).toEqual(9);
});
});
describe.only("Sum Only", () => {
describe("Sum Only", () => {
test("sum", () => {
expect(sum, 4, 5).toEqual(9);
});
});
});
What is the expected behavior?
- Run the test inside of
describe.only
when the command isbun test --only
- Run the all tests when the command is
bun test
What do you see instead?
bun test v1.0.26 (c75e768a)
index.test.ts:
0 pass
0 fail
Ran 0 tests across 1 files. [112.00ms]
Additional information
No response
Possibly related, when nesting a describe.only
inside a describe it will only execute the describe.only
nested inside a describe. Even without the --only
flag.
import { describe, expect, test } from "bun:test";
describe("Sum", () => {
test("sum", () => {
expect(1).toEqual(1);
});
});
describe("Sum Only", () => {
describe.only("Sum Only", () => {
test("sum", () => {
expect(1).toEqual(1);
});
});
describe("Sum", () => {
test("sum", () => {
expect(1).toEqual(1);
});
});
});
bun test v1.0.26 (c75e768a)
index.spec.ts:
✓ Sum Only > Sum Only > sum [0.07ms]
1 pass
0 fail
1 expect() calls
Ran 1 tests across 1 files. [24.00ms]