London | 26-ITP-Jan | Angela McLeary | Sprint 3 | Coursework/sprint 3 implement and rewrite test#1031
Conversation
…Completed the invalid cases and completed the test using Jest
…test.js and updated test in 1-get-angle-type.test.js
…test.js updated code and test
cjyuan
left a comment
There was a problem hiding this comment.
Why do we have to write so many validating cases?
Have you tried looking up the info or ask ChatGPT "Why is it important to prepare comprehensive tests in programming"?
Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js
Outdated
Show resolved
Hide resolved
@cjyuan |
…angle value and formatted code using prettier
… also formatted with Prettier
…me tests also formatted code
cjyuan
left a comment
There was a problem hiding this comment.
Changes look good! Well done!
|
|
||
| test("should return false when absolute numerator is greater than or equal to absolute denominator", () => { | ||
| expect(isProperFraction(2, 1)).toEqual(false); | ||
| }); |
There was a problem hiding this comment.
The test category is good.
To make the test more comprehensive, we could choose different combination of positive an negative values to test. For examples,
expect(isProperFraction(2, 1)).toEqual(false);
expect(isProperFraction(2, -1)).toEqual(false);
expect(isProperFraction(-2, 1)).toEqual(false);
expect(isProperFraction(-2, -1)).toEqual(false);
expect(isProperFraction(2, 2)).toEqual(false);
expect(isProperFraction(2, -2)).toEqual(false);
expect(isProperFraction(-2, 2)).toEqual(false);
expect(isProperFraction(-2, -2)).toEqual(false);
There was a problem hiding this comment.
@cjyuan Thank you. I will take note and make improvements in my future coding projects.
Learners, PR Template
Self checklist
Changelist
I developed an understanding of function scope and implemented Test-Driven Development (TDD) using Jest.
Questions
Why do we have to write so many validating cases?