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

approximatelyDeep #4058

Closed
maasencioh opened this issue Jul 18, 2017 · 5 comments
Closed

approximatelyDeep #4058

maasencioh opened this issue Jul 18, 2017 · 5 comments

Comments

@maasencioh
Copy link

This is a feature request. The idea is to have something similar to https://github.com/targos/should-approximately-deep

var a = [0.333];
expect(a).toBeDeepCloseTo([1/3], 5);

This is basically the union between toEqual and toBeCloseTo.

@cpojer
Copy link
Member

cpojer commented Jul 18, 2017

You can write your own matchers using expect.extend. Jest is not going to provide many more matchers than the existing ones out of the box at this point, unless they provide significant value to most people using Jest.

@cpojer cpojer closed this as completed Jul 18, 2017
@maasencioh
Copy link
Author

thank you @cpojer for the quick response, then I'll do that 👍

@maasencioh
Copy link
Author

if actually needs something similar this was my approach

https://github.com/maasencioh/jest-matcher-deep-close-to

@clawconduce
Copy link

This is similar to supporting objects, I made a PR to add object support to your repo

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants