@@ -5,29 +5,50 @@ beforeEach(function() {
5
5
b = Math . floor ( Math . random ( ) * 1000 )
6
6
} )
7
7
8
- it ( 'add(a, b) adds two numbers and returns the result' , function ( ) {
9
- expect ( add ( a , b ) ) . toEqual ( a + b )
10
- } )
8
+ describe ( 'basic math functions' , function ( ) {
9
+ it ( "'add()' is a valid function" , function ( ) {
10
+ expect ( add ) . toExist
11
+ } )
11
12
12
- it ( 'subtract(a, b) subtracts b from a and returns the result' , function ( ) {
13
- expect ( subtract ( a , b ) ) . toEqual ( a - b )
14
- } )
13
+ it ( " 'subtract()' is a valid function" , function ( ) {
14
+ expect ( add ) . toExist
15
+ } )
15
16
16
- it ( 'multiply(a, b) multiplies two numbers and returns the result' , function ( ) {
17
- expect ( multiply ( a , b ) ) . toEqual ( a * b )
18
- } )
17
+ it ( "'multiple()' is a valid function" , function ( ) {
18
+ expect ( add ) . toExist
19
+ } )
19
20
20
- it ( 'divide(a, b) divides a by b and returns the result' , function ( ) {
21
- expect ( divide ( a , b ) ) . toEqual ( a / b )
22
- } )
21
+ it ( " 'divide()' is a valid function" , function ( ) {
22
+ expect ( add ) . toExist
23
+ } )
23
24
24
- it ( 'inc(n) increments n and returns the result' , function ( ) {
25
- expect ( inc ( a ) ) . toEqual ( a + 1 )
25
+ it ( 'add(a, b) adds two numbers and returns the result' , function ( ) {
26
+ expect ( add ( a , b ) ) . toEqual ( a + b )
27
+ } )
28
+
29
+ it ( 'subtract(a, b) subtracts b from a and returns the result' , function ( ) {
30
+ expect ( subtract ( a , b ) ) . toEqual ( a - b )
31
+ } )
32
+
33
+ it ( 'multiply(a, b) multiplies two numbers and returns the result' , function ( ) {
34
+ expect ( multiply ( a , b ) ) . toEqual ( a * b )
35
+ } )
36
+
37
+ it ( 'divide(a, b) divides a by b and returns the result' , function ( ) {
38
+ expect ( divide ( a , b ) ) . toEqual ( a / b )
39
+ } )
40
+
41
+ it ( 'increment(n) increments n and returns the result' , function ( ) {
42
+ expect ( increment ( a ) ) . toEqual ( a + 1 )
43
+ } )
44
+
45
+ it ( 'decrement(n) decrements n and returns the result' , function ( ) {
46
+ expect ( decrement ( a ) ) . toEqual ( a - 1 )
47
+ } )
26
48
} )
27
49
28
- it ( 'dec(n) decrements n and returns the result' , function ( ) {
29
- expect ( dec ( a ) ) . toEqual ( a - 1 )
30
- } )
50
+
51
+
31
52
32
53
describe ( 'makeInt(n)' , function ( ) {
33
54
it ( 'parses n as an integer and returns the parsed integer' , function ( ) {
0 commit comments