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: add expect.closeTo() API #2827

Closed

Conversation

bartoszgolebiowski
Copy link
Contributor

@bartoszgolebiowski
Copy link
Contributor Author

can you retrigger pipelines? @sheremet-va

Copy link
Member

@sheremet-va sheremet-va left a comment

Choose a reason for hiding this comment

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

Documentation is missing. Can you add it, please? Other than that good job 👍🏻

}).toEqual({
title: '0.1 + 0.2',
sum: expect.not.closeTo(0.4, 5),
})
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a test that will actually fail?

expect(() => ...).toThrow(...)

@bartoszgolebiowski
Copy link
Contributor Author

I will!

@ghiscoding ghiscoding mentioned this pull request Jun 22, 2023
@skhaz
Copy link

skhaz commented Sep 24, 2023

This would be a great addition and would help with the adoption of Vitest. Thank you.

@ghiscoding
Copy link
Contributor

@sheremet-va @Dunqing any chance this could be picked up by one of you and completed? It doesn't look like the original author has time to complete this PR and Jest already has this feature as expect.closeTo(number, numDigits)

@sheremet-va
Copy link
Member

@sheremet-va @Dunqing any chance this could be picked up by one of you and completed? It doesn't look like the original author has time to complete this PR and Jest already has this feature as expect.closeTo(number, numDigits)

Feel free to open a separate PR 😄

@ghiscoding
Copy link
Contributor

I knew you were going to say that but I don't feel comfortable to take this one over

@Dunqing
Copy link
Member

Dunqing commented Oct 6, 2023

I will take this one over

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.

5 participants