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

expect.hasAssertions should not accept arguments #3517

Closed
alexlrobertson opened this issue May 8, 2017 · 2 comments · Fixed by renovatebot/renovate#207, renovatebot/renovate#208 or #3526

Comments

@alexlrobertson
Copy link
Contributor

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
@cpojer
Copy link
Member

cpojer commented May 8, 2017

You are right! It should throw – do you want to send a pull request for us? :)

alexlrobertson added a commit to alexlrobertson/jest that referenced this issue May 9, 2017
* `expect.hasAssertions()` should not allow useless parameters to limit
  confusion with `expect.assertions(<n>)`.

Fixes jestjs#3517
cpojer pushed a commit that referenced this issue May 11, 2017
* `expect.hasAssertions()` should not allow useless parameters to limit
  confusion with `expect.assertions(<n>)`.

Fixes #3517
tushardhole pushed a commit to tushardhole/jest that referenced this issue Aug 21, 2017
* `expect.hasAssertions()` should not allow useless parameters to limit
  confusion with `expect.assertions(<n>)`.

Fixes jestjs#3517
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.