File tree 2 files changed +26
-0
lines changed
unit-testing/exercises/tests
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ const test = require ( '../RPS.js' ) ;
2
+
3
+ test ( "returns 'TIE!' if P1 = P2" , function ( ) {
4
+ let output = test . whoWon ( player1 , player2 ) ;
5
+ expect ( output ) . toBe ( "TIE!" ) ;
6
+ } ) ;
7
+
8
+ test ( "returns 'Player 2 wins!' if P1 = rock & P2 = paper" , function ( ) {
9
+ let output = test . whoWon ( 'rock' , 'paper' ) ;
10
+ expect ( output ) . toBe ( "Player 2 wins!" ) ;
11
+ } ) ;
12
+
13
+ test ( "returns 'Player 2 wins!' if P1 = scissors & P2 = rock" , function ( ) {
14
+ let output = test . whoWon ( 'scissors' , 'rock' ) ;
15
+ expect ( output ) . toBe ( "Player 2 wins!" ) ;
16
+ } ) ;
Original file line number Diff line number Diff line change
1
+ const test = require ( '../checkFive.js' ) ;
2
+
3
+ describe ( "checkFive" , function ( ) {
4
+
5
+ test ( "should produces the correct output when passed a number less than 5." , function ( ) {
6
+ let output = checkFive ( 2 ) ;
7
+ expect ( output ) . toBe ( "2 is less than 5." ) ;
8
+ } ) ;
9
+
10
+ } ) ;
You can’t perform that action at this time.
0 commit comments