File tree Expand file tree Collapse file tree 2 files changed +60
-2
lines changed Expand file tree Collapse file tree 2 files changed +60
-2
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,19 @@ function whoWon(player1,player2){
17
17
}
18
18
19
19
return 'Player 1 wins!' ;
20
- }
20
+ }
21
+ module . exports = {
22
+ whoWon : whoWon
23
+ } ;
24
+
25
+ const test = require ( '../RPS.js' ) ;
26
+
27
+ test ( "returns 'Player 2 wins!' if P1 = rock & P2 = paper" , function ( ) {
28
+ let output = test . whoWon ( 'rock' , 'paper' ) ;
29
+ expect ( output ) . toBe ( "Player 2 wins!" ) ;
30
+ } ) ;
31
+
32
+ test ( "returns 'Player 2 wins!' if P1 = paper & P2 = scissors" , function ( ) {
33
+ let output = test . whoWon ( 'paper' , 'scissors' ) ;
34
+ expect ( output ) . toBe ( "Player 2 wins!" ) ;
35
+ } ) ;
Original file line number Diff line number Diff line change @@ -8,4 +8,47 @@ function checkFive(num){
8
8
result = num + " is greater than 5." ;
9
9
}
10
10
return result ;
11
- }
11
+ }
12
+
13
+ const test = require ( '../checkFive.js' ) ;
14
+
15
+ const checkFive = require ( '../checkFive.js' ) ;
16
+
17
+ describe ( "checkFive" , function ( ) {
18
+
19
+ test ( "Descriptive feedback..." , function ( ) {
20
+ //code here...
21
+ } ) ;
22
+
23
+ } ) ;
24
+
25
+ const checkFive = require ( '../checkFive.js' ) ;
26
+
27
+ describe ( "checkFive" , function ( ) {
28
+
29
+ test ( "Descriptive feedback..." , function ( ) {
30
+ let output = checkFive ( 2 ) ;
31
+ } ) ;
32
+
33
+ } ) ;
34
+
35
+ const checkFive = require ( '../checkFive.js' ) ;
36
+
37
+ describe ( "checkFive" , function ( ) {
38
+
39
+ test ( "Descriptive feedback..." , function ( ) {
40
+ let output = checkFive ( 2 ) ;
41
+ expect ( output ) . toEqual ( "2 is less than 5." ) ;
42
+ } ) ;
43
+
44
+ } ) ;
45
+
46
+ test ( "returns 'num is less than 5' when num < 5." , function ( ) {
47
+ // test code //
48
+ } ) ;
49
+
50
+ expect ( output ) . toBe ( "2 is less than 5." ) ;
51
+
52
+ if ( num > 5 ) {
53
+ // sourcecode //
54
+ }
You can’t perform that action at this time.
0 commit comments