import { inspect } from "adapter/util/inspect" ; import { chance } from "_/helpers" ; describe ( "util/" , ( ) => { describe ( "inspect" , ( ) => { it ( "should handle undefined" , ( ) => { expect ( inspect ( undefined ) ) . toEqual ( "undefined" ) ; } ) ; it ( "should handle null" , ( ) => { expect ( inspect ( null ) ) . toEqual ( "null" ) ; } ) ; it ( "should handle number" , ( ) => { const value = chance . integer ( ) ; expect ( inspect ( value ) ) . toEqual ( `${ value }` ) ; } ) ; it ( "should handle string" , ( ) => { const value = chance . string ( ) ; expect ( inspect ( value ) ) . toEqual ( `'${ value }'` ) ; } ) ; it ( "should handle empty string" , ( ) => { expect ( inspect ( "" ) ) . toEqual ( "''" ) ; } ) ; it ( "should handle object" , ( ) => { expect ( inspect ( { data : true } ) ) . toEqual ( "{ \"data\": true }" ) ; } ) ; it ( "should handle function" , ( ) => { expect ( inspect ( ( x , y ) => x + y ) ) . toEqual ( "function (x, y) { return x + y; }" ) ; } ) ; } ) ; } ) ;