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

added tests #391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

valeriaoleynik
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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`, () => {

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`, () => {

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`, () => {

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`, () => {

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`, () => {

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'.

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.

2 participants