@@ -14,11 +14,12 @@ describe('Fundamentals #1', function() {
14
14
catch ( e ) {
15
15
console . log ( e )
16
16
}
17
- it ( 'colors is an array' , function ( ) {
18
- expect ( colors ) . to . be . an ( 'array' )
17
+ it ( 'foods is an array' , function ( ) {
18
+ expect ( foods ) . to . be . an ( 'array' )
19
19
} )
20
- it ( 'colors contains three colors' , function ( ) {
21
- expect ( colors . length ) . to . equal ( 3 )
20
+ it ( 'foods contains three strings' , function ( ) {
21
+ expect ( foods . length ) . to . equal ( 3 )
22
+ expect ( foods . every ( food => food . constructor === String ) ) . to . equal ( true )
22
23
} )
23
24
} )
24
25
@@ -36,8 +37,8 @@ describe('Fundamentals #2', function() {
36
37
it ( 'last is a string' , function ( ) {
37
38
expect ( last ) . to . be . a ( 'string' )
38
39
} )
39
- it ( 'last is equal to the last item in colors ' , function ( ) {
40
- expect ( last ) . to . equal ( colors [ 2 ] )
40
+ it ( 'last is equal to the last item in foods ' , function ( ) {
41
+ expect ( last ) . to . equal ( foods [ 2 ] )
41
42
} )
42
43
} )
43
44
@@ -52,11 +53,11 @@ describe('Fundamentals #3', function() {
52
53
catch ( e ) {
53
54
console . log ( e )
54
55
}
55
- it ( 'favoriteColors is defined' , function ( ) {
56
- expect ( favoriteColors ) . to . be . not . undefined
56
+ it ( 'favoriteFoods is defined' , function ( ) {
57
+ expect ( favoriteFoods ) . to . be . not . undefined
57
58
} )
58
- it ( 'favoriteColors is an array' , function ( ) {
59
- expect ( favoriteColors ) . to . be . an ( 'array' )
59
+ it ( 'favoriteFoods is an array' , function ( ) {
60
+ expect ( favoriteFoods ) . to . be . an ( 'array' )
60
61
} )
61
62
} )
62
63
@@ -77,14 +78,14 @@ describe('Fundamentals #4', function() {
77
78
catch ( e ) {
78
79
console . log ( e )
79
80
}
80
- it ( 'favoriteColors contains three colors ' , function ( ) {
81
- expect ( favoriteColors . length ) . to . equal ( 3 )
81
+ it ( 'favoriteFoods contains three foods ' , function ( ) {
82
+ expect ( favoriteFoods . length ) . to . equal ( 3 )
82
83
} )
83
- it ( 'favoriteColors contains the same values as colors ' , function ( ) {
84
+ it ( 'favoriteFoods contains the same values as foods ' , function ( ) {
84
85
expect (
85
- favoriteColors . reduce ( ( a , b ) => a + b )
86
+ favoriteFoods . reduce ( ( a , b ) => a + b )
86
87
) . to . equal (
87
- colors . reduce ( ( a , b ) => a + b )
88
+ foods . reduce ( ( a , b ) => a + b )
88
89
)
89
90
} )
90
91
} )
@@ -104,7 +105,10 @@ describe('Fundamentals #5', function() {
104
105
expect ( instructor ) . to . be . an ( 'object' )
105
106
} )
106
107
it ( 'instructor has three key-value pairs' , function ( ) {
107
- expect ( Object . keys ( instructor ) . length ) . to . be . greaterThan ( 2 )
108
+ expect ( Object . keys ( instructor ) ) . to . have . lengthOf ( 3 )
109
+ } )
110
+ it ( 'instructor does not have a \'has-office-hours\' property' , function ( ) {
111
+ expect ( instructor ) . to . not . have . any . keys ( 'has-office-hours' )
108
112
} )
109
113
} )
110
114
@@ -118,10 +122,13 @@ describe('Fundamentals #6', function() {
118
122
catch ( e ) {
119
123
console . log ( e )
120
124
}
121
- it ( 'instructor has a facial-hair property' , function ( ) {
122
- expect ( Object . keys ( instructor ) ) . to . include ( 'facial-hair' )
125
+ it ( 'instructor has four key-value pairs' , function ( ) {
126
+ expect ( Object . keys ( instructor ) . length ) . to . be . equal ( 4 )
127
+ } )
128
+ it ( 'instructor has a has-office-hours property' , function ( ) {
129
+ expect ( instructor ) . to . have . property ( 'has-office-hours' )
123
130
} )
124
- it ( 'facial-hair has a boolean value' , function ( ) {
125
- expect ( instructor [ 'facial-hair' ] ) . to . be . a ( 'boolean' )
131
+ it ( 'has-office-hours has a boolean value' , function ( ) {
132
+ expect ( instructor ) . property ( 'has-office-hours' ) . to . be . a ( 'boolean' )
126
133
} )
127
134
} )
0 commit comments