-
Notifications
You must be signed in to change notification settings - Fork 0
Class3 tests #6
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
base: gh-pages
Are you sure you want to change the base?
Class3 tests #6
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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