Conversation
There was a problem hiding this comment.
You understood how the tests functioned in 'should detect which hand won', but you didn't implement that in 'should check for unassigned words'. Additionally, your last else if in the rps function is incorrect. Please meet with me before class or during office hours and we can go over your code! Also, please do not edit code unrelated to the homework on the same branch (01week/rockPaperScissors.js).
| assert.equal(rockPaperScissors('paper', 'paper'), "It's a tie!"); | ||
| assert.equal(rockPaperScissors('scissors', 'scissors'), "It's a tie!"); | ||
| }); | ||
| it('should detect which hand won', () => { |
There was a problem hiding this comment.
Very nice, you've tested for all possible win cases!
02week/tests.js
Outdated
| //Check for player two win | ||
| } else if (hand1 === 'rock' && hand2 === 'paper' || hand1 === 'paper' && hand2 === 'scissors' || hand1 === 'scissors' && hand2 === 'rock') { | ||
| return "Hand two wins!" | ||
| }else if (hand1 && hand2 !== 'rock', 'paper', 'scissors'){ |
There was a problem hiding this comment.
This is not how you check if hand1 and hand2 are not equal to rock or paper or scissors. It will probably throw an error.
02week/tests.js
Outdated
| assert.equal(rockPaperScissors('rock ', 'sCiSsOrs'), "Hand one wins!"); | ||
| }); | ||
| it('shoulde check for unassigned words', () => { | ||
| assert.notEqual(rockPaperScissors('rock, paper, scissors', 'rock, paper, scissors'), "You are not playing the game right!"); |
There was a problem hiding this comment.
You're passing in two identical strings, which will return "It's a tie!", then asserting that the return is NOT equal to "You are not playing the game right". This test will always pass.
stu-k
left a comment
There was a problem hiding this comment.
Yay! You fixed the things! Everything looks good. Despite that fact, please do not merge, because of all the file changes and whatever. So 100%! But don't merge :D
Checkpoint Rubric
This is the rubric that your instructor will use to grade your checkpoints. Please do not edit.
Checkpoint 1
Checkpoint 2
Checkpoint 3