Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange test .only() behavior without --only #3550

Closed
utftu opened this issue Jul 6, 2023 · 2 comments
Closed

Strange test .only() behavior without --only #3550

utftu opened this issue Jul 6, 2023 · 2 comments
Labels
bug Something isn't working bun:test Something related to the `bun test` runner

Comments

@utftu
Copy link

utftu commented Jul 6, 2023

What version of Bun is running?

0.6.13

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

Create three test files:

src/number.test.ts

import { it } from "bun:test";

it.only("number", () => {});

src/object.test.ts

import { it } from "bun:test";

it('object', () => {})

src/string.test.ts

import { it } from "bun:test";

it('string', () => {})

and runbun test (without --only)

What is the expected behavior?

bun run all test

What do you see instead?

bun run tests in src/string.test.ts and src/number.test.ts: but not in src/object.test.ts

Additional information

If you do not place the files in the src directory, only number.test.ts will be executed.

@utftu utftu added the bug Something isn't working label Jul 6, 2023
@utftu utftu changed the title Strange .only() behavior without --only Strange test .only() behavior without --only Jul 6, 2023
@robobun robobun added the bun:test Something related to the `bun test` runner label Jul 6, 2023
@Electroid
Copy link
Contributor

Thanks for reporting, we'll investigate and fix this. What is likely happening is as soon as the first .only is being encountered, the test runner is closing early.

@Jarred-Sumner
Copy link
Collaborator

Fixed in Bun v1.1.26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun:test Something related to the `bun test` runner
Projects
None yet
Development

No branches or pull requests

4 participants