param { Promise } promise param { string } message returns export async function invert ( promise , message ? ) { message = message || 'Expected promise to reject' ; return promise . then ( ( ) => { throw new Error ( message ) ; } , err => err ) ; }