Skip to content

expect.hasAssertion and expect.assertions silently pass outside bdd tests #6518

Closed
@WWRS

Description

@WWRS

Describe the bug

expect.hasAssertion and expect.assertions always pass even when there are not the right number of assertions

Steps to Reproduce

import { expect } from "jsr:@std/expect";

Deno.test("should fail", () => {
    expect.hasAssertions();
});

Deno.test("should also fail", () => {
    expect.assertions(2);
    expect(1).toBe(1);
});

Expected behavior

Both tests fail

Environment

  • OS: Win11
  • deno version: 2.2.5
  • std version: 1.0.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions