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

Implement toThrow #6267

Merged
merged 6 commits into from
Jul 31, 2024
Merged

Implement toThrow #6267

merged 6 commits into from
Jul 31, 2024

Conversation

Latropos
Copy link
Contributor

@Latropos Latropos commented Jul 15, 2024

Summary

In the future the matcher toThrow should replace .FAILING and .WARNING test decorators.
It allows more flexibility, as it is easy to add .not modificator and test that given code doesn't throw unexpected errors.

Test plan

@Latropos Latropos marked this pull request as ready for review July 15, 2024 12:45
@Latropos Latropos requested a review from piaskowyk July 15, 2024 12:45
Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the case doesn't works 🤔

await expect(() => {
  throw new Error('OH, NO!');
}).toThrow();

image

@Latropos Latropos requested a review from piaskowyk July 30, 2024 15:10
Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be ok, but lets remove duplicated mockConsole in the next PR

@Latropos Latropos enabled auto-merge July 31, 2024 10:35
@Latropos Latropos added this pull request to the merge queue Jul 31, 2024
Merged via the queue into main with commit d998770 Jul 31, 2024
5 checks passed
@Latropos Latropos deleted the acynk/implement-to-throw branch July 31, 2024 10:36
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.

2 participants