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

test: support test.failing #15887

Open
DonIsaac opened this issue Dec 19, 2024 · 0 comments · May be fixed by #14829
Open

test: support test.failing #15887

DonIsaac opened this issue Dec 19, 2024 · 0 comments · May be fixed by #14829
Labels
bun:test Something related to the `bun test` runner ecosystem Something that relates to package or framework compatibility enhancement New feature or request

Comments

@DonIsaac
Copy link
Contributor

DonIsaac commented Dec 19, 2024

What is the problem this feature would solve?

Add test.failing to bun:test with the same behavior as Jest.

// foo.test.ts
describe("foo", () => {
  function foo() {
    return 2
  }

  test.failing("passes if any expectation fails or an error is thrown", () => {
    expect(foo()).toBe(1);
  })

  // this test fails
  test.failing("fails if the test 'passes': that is, no expectations fail", () => {
    expect(foo()).toBe(2)
  })

  it.failing("is also on 'it'", () => {
    expect(foo()).toBe(1)
  })
})

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

Helps developers keep track of known bugs. This is better than .todo since it forces the .failing modifier to be removed once the bug is fixed.

This also brings us closer to feature parity with Jest.

What alternatives have you considered?

No response

@DonIsaac DonIsaac added bun:test Something related to the `bun test` runner enhancement New feature or request ecosystem Something that relates to package or framework compatibility labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bun:test Something related to the `bun test` runner ecosystem Something that relates to package or framework compatibility enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant