function errorMatches (actual, expected) {
        if (typeof expected === 'string') {
            return actual.message === expected;
        }
        if (Object.prototype.toString.call(expected) === '[object RegExp]') {
            return expected.test(actual.message);
        }
        if (actual instanceof expected) {
            return true;
        }
        return false;
    }
// Utility for checking whether an error matches a given constructor, regexp or string
Utility for checking whether an error matches a given constructor, regexp or string
Utility for checking whether an error matches a given constructor regexp or string
function errorMatches (actual, expected) {
        if (typeof expected === 'string') {
            return actual.message === expected;
        }
        if (Object.prototype.toString.call(expected) === '[object RegExp]') {
            return expected.test(actual.message);
        }
        if (actual instanceof expected) {
            return true;
        }
        return false;
    }
function errorMatches ( actual , expected ) { if ( typeof expected === 'string' ) { return actual . message === expected ; } if ( Object . prototype . toString . call ( expected ) === '[object RegExp]' ) { return expected . test ( actual . message ) ; } if ( actual instanceof expected ) { return true ; } return false ; }
Utility for checking whether an error matches a given constructor, regexp or string
Utility for checking whether an error matches a given constructor regexp or string