-
Notifications
You must be signed in to change notification settings - Fork 399
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
added tests #391
base: main
Are you sure you want to change the base?
added tests #391
Conversation
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.
Great job on implementing the getCoinCombination
function! 🎉 The function correctly calculates the coin combinations, and the input validation is spot on. While there are suggestions for improving test descriptions, they don't impact the functionality. Keep up the good work and consider refining test descriptions for clarity in the future! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
@@ -7,4 +7,25 @@ describe('getCoinCombination', () => { | |||
expect(getCoinCombination) | |||
.toBeInstanceOf(Function); | |||
}); | |||
|
|||
it(`throw an error if 'cents' is negative non-integer number`, () => { |
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.
The test description should be more precise. Consider rephrasing it to something like: 'should throw an error if cents is a negative non-integer number'.
.toThrow(); | ||
}); | ||
|
||
it(`return '[1, 0, 0, 0]' if 'coins' = 1`, () => { |
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.
The test description should be more precise. Consider rephrasing it to something like: 'should return [1, 0, 0, 0] if cents is 1'.
expect(getCoinCombination(1)).toEqual([1, 0, 0, 0]); | ||
}); | ||
|
||
it(`return '[1, 1, 0, 0]' if 'coins' = 6`, () => { |
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.
The test description should be more precise. Consider rephrasing it to something like: 'should return [1, 1, 0, 0] if cents is 6'.
expect(getCoinCombination(6)).toEqual([1, 1, 0, 0]); | ||
}); | ||
|
||
it(`return '[2, 1, 1, 0]' if 'coins' = 17`, () => { |
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.
The test description should be more precise. Consider rephrasing it to something like: 'should return [2, 1, 1, 0] if cents is 17'.
expect(getCoinCombination(17)).toEqual([2, 1, 1, 0]); | ||
}); | ||
|
||
it(`return '[0, 0, 0, 2]' if 'coins' = 50`, () => { |
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.
The test description should be more precise. Consider rephrasing it to something like: 'should return [0, 0, 0, 2] if cents is 50'.
No description provided.