-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Solution #1090
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
base: main
Are you sure you want to change the base?
Solution #1090
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,11 +3,19 @@ | |
| const splitInteger = require('./splitInteger'); | ||
|
|
||
| test(`should split a number into equal parts | ||
| if a value is divisible by a numberOfParts`, () => {}); | ||
| if a value is divisible by a numberOfParts`, () => { | ||
| expect(splitInteger(6, 2)).toEqual([3, 3]); | ||
| }); | ||
|
|
||
| test(`should return a part equals to a value | ||
| when splitting into 1 part`, () => {}); | ||
| when splitting into 1 part`, () => { | ||
| expect(splitInteger(6, 1)).toEqual([6]); | ||
| }); | ||
|
|
||
| test('should sort parts ascending if they are not equal', () => {}); | ||
| test('should sort parts ascending if they are not equal', () => { | ||
| expect(splitInteger(13, 3)).toEqual([4, 4, 5]); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test case is not in the requirements. The task specifies these exact cases: (8,1), (6,2), (17,4), (32,6). This test can be removed. |
||
| }); | ||
|
|
||
| test('should add zeros if value < numberOfParts', () => {}); | ||
| test('should add zeros if value < numberOfParts', () => { | ||
| expect(splitInteger(3, 4)).toEqual([0, 1, 1, 1]); | ||
|
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test case is not in the requirements. The task specifies these exact cases: (8,1), (6,2), (17,4), (32,6). This test can be removed.
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required test case
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required test case |
||
| }); | ||
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 task requirements specify testing
splitInteger(8, 1) === [8], but this test usessplitInteger(6, 1) === [6]. Please use the exact value 8 as specified.