Skip to content

expect.hasAssertions should not accept arguments #3517

Description

@alexlrobertson

Do you want to request a feature or report a bug?

Feature

What is the current behavior?

Calling expect.hasAssertions(3) results in no change from the behavior of expect.hasAssertions(). This is confusing with the expect.assertions(<n>) API that does change based on the parameters.

What is the expected behavior?

expect.hasAssertions(<any>) should throw an error like other expectations that ensure no expected paramters.

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

  • jest@20.0.0
  • jest-cli@20.0.0
  • babel-jest@20.0.0
  • npm@3.10.10
  • node@6.10.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions