Repository navigation
Conversation
added in code for checks for J Q K and A
valid single digit card Arbitrary non-card string Incorrect suit
Copied test code for other angles.
Added in test for Basic proper fraction: Numerator < Denominator
Added code for Number cards 2-10
fixed error on numbered cards.
…g () => in my thrown error tests
…itive tests. Changed to to.Throw (...) to ensure test is correct.
… attempt to cover all bases. 17 tests now.
letter for suite - incorrect Lower case - incorrect No input
|
About card test cases, the design process could be: for valid case:
for invalid case:
If you have the above planning before actual coding the test cases, then you can make sure that all combinations would be covered. Similar to my previous comment on #1670 (comment) , draft the test plan in English first, then write the test in code. Once again, please feel free to book a mentored coding session with a volunteer. I think after you tidy up the test cases in |
…d string. Checking each test to ensure accurate.
…ut. 20 tests in total now.
| // any B-Z except J/Q/K with valid suit | ||
| test("Incorrect royal face given: 7L", () => { | ||
| assert.throws( | ||
| () => getCardValue("7L"), |
There was a problem hiding this comment.
This should be () => getCardValue("L♦"), I think. I will let you pass this time but please pay attention to detail in the future. Thank you.
|
|
||
| // number 10 (double digit number) with valid suit | ||
| test(`Should return 10 value when given an 10 face card`, () => { | ||
| expect(getCardValue("2♠")).toEqual(2); |
There was a problem hiding this comment.
This should be expect(getCardValue("10♠")).toEqual(10);, I think. I will let you pass this time but please pay attention to detail in the future. Thank you.
There was a problem hiding this comment.
Woops, thanks and I thought I went through it with a microscope.
|
I would mark this PR as completed. Please book a mentored coding session with volunteer if you would like to learn better. Thank you. |
Learners, PR Template
Self checklist
Task code
CYF-1059.
Changelist
I built code while writing tests for the code using node and jest to test.