const { RandomUtil } = require ( '@wireapp/commons' ) ; testEnvironment describe ( 'RandomUtil' , ( ) => { describe ( '"randomInt"' , ( ) => { it ( 'respects limit' , ( ) => { const iterations = 100 ; const randomLimit = 10 ; for ( let index = 0 ; index < iterations ; index ++ ) { if ( RandomUtil . randomInt ( randomLimit ) > randomLimit ) { fail ( `randomInt() exeeded limit "${ randomLimit }"` ) ; } } } ) ; } ) ; describe ( '"randomArrayElement"' , ( ) => { it ( 'returns undefined on empty array' , ( ) => { const actual = RandomUtil . randomArrayElement ( [ ] ) ; expect ( actual ) . toEqual ( undefined ) ; } ) ; } ) ; } ) ;