Repository navigation
Cape Town | 26-ITP-Sept | Vaidah Simenti | Sprint 2 | Coursework/Implement and Rewrite Tests - #1676
Vaidah-dev wants to merge 12 commits into
Conversation
hackertainment
left a comment
There was a problem hiding this comment.
Thank you for you coursework and just some minor fixes required. Please keep it up.
There was a problem hiding this comment.
Good coverage of test cases (except angle 90 tested two times ^^" ).
| }); | ||
|
|
||
| test("Negative cases", () => { | ||
| assert.equal(isProperFraction(-2, 1), true); |
| test("Negative cases", () => { | ||
| assert.equal(isProperFraction(-2, 1), true); | ||
| assert.equal(isProperFraction(1, -2), false); | ||
| assert.equal(isProperFraction(-1, -2), false); |
| }); | ||
|
|
||
| test("Zero cases", () => { | ||
| assert.equal(isProperFraction(0, 1), true); |
| }); | ||
|
|
||
| test("Zero cases", () => { | ||
| expect(isProperFraction(0, 1)).toEqual(true); |
| test("Negative cases", () => { | ||
| expect(isProperFraction(-2, 1)).toEqual(true); | ||
| expect(isProperFraction(1, -2)).toEqual(false); | ||
| expect(isProperFraction(-1, -2)).toEqual(false); |
| }); | ||
|
|
||
| test("Negative cases", () => { | ||
| expect(isProperFraction(-2, 1)).toEqual(true); |
| expect(() => getCardValue("♠")).toThrow(); | ||
| expect(() => getCardValue("11♠")).toThrow(); | ||
| expect(() => getCardValue("hello")).toThrow(); | ||
| expect(() => getCardValue("")).toThrow(); |
There was a problem hiding this comment.
Would this test case throw your Expected a number followed by a suit, but got "" error or throwing another type or error?
| assert.throws(() => getCardValue("11♠")); | ||
| assert.throws(() => getCardValue("1♠")); | ||
| assert.throws(() => getCardValue("hello")); | ||
| assert.throws(() => getCardValue("")); |
There was a problem hiding this comment.
Would this test case throw your Expected a number followed by a suit, but got "" error or throwing another type or error?
|
Thank you for the review! I've addressed all the comments: fixed the isProperFraction tests, added error message checks to getCardValue, and cleaned up get-angle-type. |
|
Congratulation, you have completed this PR successfully. Well done! |
Self checklist
Task code
(CYF-1059).
Changelist
-Implemented :
getAngleType,isProperFraction,getCardValueand for each function ran tests using Node's built in test runner as well as rewriting using Jest.