This repository has been archived by the owner on Aug 15, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unit tests #67
Unit tests #67
Changes from all commits
d98ca3a
4ff10fc
78b2950
8bb8d01
2bb3be5
4bdfc5a
9ec7f11
94e9323
7e35154
58957ea
e5b1056
c497001
438e592
e3248a8
e43ae2f
bfd062f
8918c50
b157816
91658db
e76725c
8ec4b54
c959b12
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this bleed into a different test suite? Do you need to "undo" this patch after all of these tests have run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. It won't right now but it is safe to add a
clearAllMocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@biharck, if you use Math.random somewhere else, I think it would still be a jest.fn? Doesn't clearAllMocks just reset the function so you can see what args are passed?
I think you need to do something like...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example: jestjs/jest#7136 (comment)
But I think you're right that
Math.random
calls in other test suites would use the baked in implementation, and not the one we override here.