function promiseShouldFail(promise, done, handler) {
    promise.then(result => done(new Error('Promise expected to fail'))).
    catch(error => {
        handler(error)
        done()
    }).
    catch(error => done(error))
}
function promiseShouldFail(promise, done, handler) {
    promise.then(result => done(new Error('Promise expected to fail'))).
    catch(error => {
        handler(error)
        done()
    }).
    catch(error => done(error))
}
function promiseShouldFail ( promise , done , handler ) { promise . then ( result => done ( new Error ( 'Promise expected to fail' ) ) ) . catch ( error => { handler ( error ) done ( ) } ) . catch ( error => done ( error ) ) }
Test a promise for failure
Test a promise for failure