Skip to content

Implement toThrow#6267

Merged
Latropos merged 6 commits into
mainfrom
acynk/implement-to-throw
Jul 31, 2024
Merged

Implement toThrow#6267
Latropos merged 6 commits into
mainfrom
acynk/implement-to-throw

Conversation

@Latropos
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread apps/common-app/src/examples/RuntimeTests/ReJest/matchers/rawMatchers.ts Outdated
@Latropos Latropos requested a review from piaskowyk July 30, 2024 15:10
Copy link
Copy Markdown
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
@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