jestjs / jest

Delightful JavaScript Testing.
https://jestjs.io
MIT License
44.33k stars 6.47k forks source link

[Feature]: Expose all matchers as asymmetric matchers #15102

Open lcswillems opened 6 months ago

lcswillems commented 6 months ago

🚀 Feature Proposal

This is a copy of the issue https://github.com/jestjs/jest/issues/14700 with slight modifications.

Making all matchers available as asymmetric matchers.

Motivation

How to check if the value of a property of an object is greater than 10? There is no easy way to do in Jest.

Example

expect({ value: 11 }).toMatchObject({ value: expect.toBeGreaterThan(10) });

Pitch

This shouldn't require an additional matcher library since the goal is not to add any new matchers. It's simply a case of removing an unnecessary limitation on existing matchers.

github-actions[bot] commented 5 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

lcswillems commented 5 months ago

Should not be closed

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

lcswillems commented 4 months ago

What's the point of closing if there is no activity? Doesn't mean the issue went away. And it's really not respectful for the time the people put into creating the issue and sharing feedback. @SimenB Possible to remove this?

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

lcswillems commented 3 months ago

Still

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

lcswillems commented 2 months ago

Bro, stop posting this message

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

lcswillems commented 1 month ago

No

github-actions[bot] commented 1 day ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

lcswillems commented 1 day ago

No