Skip to content

bun test runner fails when test names contain regex control characters #45746

@pckilgore

Description

@pckilgore

Reproduction steps

Create a test:

import { expect, test } from "bun:test";

test("2 plus 2", () => {
  expect(2 + 2).toBe(4);
});

Click Play Icon in Zed:

Image

Works.

Modify test to:

import { expect, test } from "bun:test";

test("2 + 2", () => {
  expect(2 + 2).toBe(4);
});

Click Play Icon in Zed.

Operations fails with:

error: regex "2 + 2" matched 0 tests. Searched 1 file (skipping 1 test) [4.00ms]

Current vs. Expected behavior

Current: Zed fails to match test to run
Expected: Zed matches test to run

Zed version and system specs

Zed: v0.217.3+stable.105.80433cb239e868271457ac376673a5f75bc4adb1 (Zed)
OS: macOS 26.1
Memory: 24 GiB
Architecture: aarch64

Attach Zed log file

No relevant logs, see above.

Relevant Zed settings

N/A

Relevant Keymap

N/A

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:languagesAn umbrella label for all programming languages syntax behaviorsfrequency:commonBugs that happen for at least a third of the users across all platforms and kinds of usagemeta:easy repro stepsSteps to reproduce are easypriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsstate:needs reproNeeds reproduction steps / someone to reproduce

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions