@@ -20,16 +20,27 @@ as the object doesn't contains a key of 'c'
2020// Given an empty object
2121// When passed to contains
2222// Then it should return false
23- test . todo ( "contains on empty object returns false" ) ;
23+ test ( "contains on empty object returns false" , ( ) => {
24+ expect ( contains ( { } , "a" ) ) . toBe ( false ) ;
25+ } ) ;
2426
2527// Given an object with properties
2628// When passed to contains with an existing property name
2729// Then it should return true
30+ test ( "contains returns true for existing property" , ( ) => {
31+ expect ( contains ( { a : 1 , b : 2 } , "a" ) ) . toBe ( true ) ;
32+ } ) ;
2833
2934// Given an object with properties
3035// When passed to contains with a non-existent property name
3136// Then it should return false
37+ test ( "contains returns false for non-existent property" , ( ) => {
38+ expect ( contains ( { a : 1 , b : 2 } , "c" ) ) . toBe ( false ) ;
39+ } ) ;
3240
3341// Given invalid parameters like an array
3442// When passed to contains
3543// Then it should return false or throw an error
44+ test ( "contains returns false for invalid parameters" , ( ) => {
45+ expect ( contains ( 3 , "a" ) ) . toBe ( false ) ;
46+ } ) ;
0 commit comments