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

feat(expect): add expect.{closeTo, stringContaining, stringMatching} #4508

Merged
merged 7 commits into from
Mar 26, 2024
Merged

feat(expect): add expect.{closeTo, stringContaining, stringMatching} #4508

merged 7 commits into from
Mar 26, 2024

Conversation

babiabeo
Copy link
Contributor

@babiabeo babiabeo commented Mar 20, 2024

This PR adds these following asymmetric matchers:

  • expect.closedTo
  • expect.stringContaining
  • expect.not.stringContaining
  • expect.stringMatching
  • expect.not.stringMatching

Ref: #3964

@babiabeo babiabeo requested a review from kt3k as a code owner March 20, 2024 15:23
@babiabeo babiabeo changed the title feat(expect): add expect.{closeTo, stringContaining, stringMatching} feat(expect): add expect.{closeTo, stringContaining, stringMatching} Mar 20, 2024
expect/mod.ts Outdated Show resolved Hide resolved
expect/mod.ts Outdated
Comment on lines 51 to 64
* The asymmetric matchers are not yet fully supported:
* - Supported:
* - `expect.anything`
* - `expect.any`
* - `expect.arrayContaining`
* - `expect.not.arrayContaining`
* - `expect.closedTo`
* - `expect.stringContaining`
* - `expect.not.stringContaining`
* - `expect.stringMatching`
* - `expect.not.stringMatching`
* - Not supported:
* - `expect.objectContaining`
* - `expect.not.objectContaining`
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't make sense. Within a list of symbols that are not fully supported, there's a list of symbols that are supported. Can you please correct and clarify?

Copy link
Member

Choose a reason for hiding this comment

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

Which ones are you referring to?

expect/mod.ts Outdated
Comment on lines 66 to 73
* The uitlities are not yet fully supported:
* - Supported:
* - `expect.addEqualityTester`
* - `expect.extend`
* - Not supported:
* - `expect.assertions`
* - `expect.hasAssertions`
* - `expect.addSnapshotSerializer`
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto. This doesn't make sense for the same reason as the above list. Please correct and clarify.

expect/_asymmetric_matchers.ts Outdated Show resolved Hide resolved
@babiabeo babiabeo requested a review from iuioiua March 25, 2024 13:34
@babiabeo
Copy link
Contributor Author

Let me know if these changes make sense to you. 👍

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

Stylistically, LGTM. I'll leave it to @kt3k to review the implementation. Thank you, @babiabeo!

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM. Nice work!

@kt3k kt3k merged commit 1c38d2c into denoland:main Mar 26, 2024
14 checks passed
@babiabeo babiabeo deleted the add-asymmetric-matchers branch March 26, 2024 03:03
@kt3k kt3k mentioned this pull request Apr 2, 2024
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants