-
Notifications
You must be signed in to change notification settings - Fork 0
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
Development #1
base: master
Are you sure you want to change the base?
Development #1
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.
Please, add test cases
src/script.js
Outdated
const getSumPositive = (a, b, c) => { | ||
let result = 0; | ||
|
||
if (a >= 0 && b >= 0 && c >= 0) { |
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.
a = 4, b = -2, c = 3 should return 7. Your function will return 0; Why?
Please, read the task carefully.
src/script.js
Outdated
for (let i = 0; i < num / 2; i++) { | ||
if (num % i) { | ||
return false; | ||
} | ||
} |
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.
Why from 0? Why if (num % i) ? check if (!(num % i))
const actual = getMinIndex(arr); | ||
|
||
assert.deepEqual(actual, expected); | ||
}); |
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.
Arrays are checked for 5 cases. I see only 3. Listen carefully on lessons
it('should be return [3, 17, 80, 40, 15, 5] ([5, 15, 40, 80, 17, 3])', () => { | ||
const arr = [5, 15, 40, 80, 17, 3]; | ||
const expected = [3, 17, 80, 40, 15, 5]; | ||
const actual = getRevArr(arr); |
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.
empty line before actual
assert.deepEqual(actual, expected); | ||
}); | ||
|
||
it('should be return [3, 17] ([17, 3])', () => { |
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.
should return
assert.deepEqual(actual, expected); | ||
}); | ||
|
||
it('should be return Array length is negative ([1, 2, 3, 4, 5])', () => { |
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.
should return [4, 5, 3, 1, 2]
No description provided.