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

Remove fail() from tests #1202

Merged
merged 1 commit into from
Feb 26, 2024
Merged

Remove fail() from tests #1202

merged 1 commit into from
Feb 26, 2024

Conversation

hectorgomezv
Copy link
Member

@hectorgomezv hectorgomezv commented Feb 23, 2024

Summary

Although fail is included in @types/jest, it is not part of the jest API anymore (see this related issue: jestjs/jest#11698).

This was not detected because fail throws an error as a side effect, which is the ultimate purpose of fail in the tests, but the error being thrown is ReferenceError, due to the use of an undefined function:

Screenshot 2024-02-23 at 13 26 26

(Note: the fail function is part of the jest-extended library, but this library is not currently installed (see: https://jest-extended.jestcommunity.dev/docs/matchers/fail)

Changes

  • Removes fail calls from tests, to use plain promise rejections instead.

@hectorgomezv hectorgomezv self-assigned this Feb 23, 2024
@hectorgomezv hectorgomezv requested a review from a team as a code owner February 23, 2024 15:44
@hectorgomezv hectorgomezv changed the title Remove undefined fail call from tests Remove fail() from tests Feb 23, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8021607983

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.05%) to 93.645%

Files with Coverage Reduction New Missed Lines %
src/routes/transactions/entities/tests/human-description.builder.ts 4 60.0%
Totals Coverage Status
Change from base Build 8020528774: -0.05%
Covered Lines: 6081
Relevant Lines: 6283

💛 - Coveralls

@hectorgomezv hectorgomezv merged commit 08181bf into main Feb 26, 2024
16 checks passed
@hectorgomezv hectorgomezv deleted the remove-fail-call-from-tests branch February 26, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants