Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions 02week/tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

if (typeof describe === 'function') {

describe('#rockPaperScissors()', () => {
it('should be a valid entry', () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't testing for valid entries, it's testing for ties.

assert.equal(rockPaperScissors('rock', 'rock'), "It's a tie!");
assert.equal(rockPaperScissors('paper', 'paper'), "It's a tie!");
assert.equal(rockPaperScissors('scissors', 'scissors'), "It's a tie!");
});
it('hand one should win', () => {
assert.equal(rockPaperScissors('paper', 'rock'), "Hand one wins!");
assert.equal(rockPaperScissors('scissors', 'paper'), "Hand one wins!");
assert.equal(rockPaperScissors('rock', 'scissors'), "Hand one wins!");
});
it('hand two should win', () => {
assert.equal(rockPaperScissors('rock', 'paper'), "Hand two wins!");
assert.equal(rockPaperScissors('paper', 'scissors'), "Hand two wins!");
assert.equal(rockPaperScissors('scissors', 'rock'), "Hand two wins!");
});
});
} else {

getPrompt();

}

// Test for all possible scenarios in which "Hand one wins!".
// Test for all possible scenarios in which "Hand two wins!".
// Test to make sure user must input a valid entry (e.g. 'rock', 'paper', or 'scissors')
// Think of more tests you could write and try writing them.
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.