Created
November 6, 2017 11:19
-
-
Save joeeames/3fb07e9088f61bbe2c324184442858ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beforeEach(() => { | |
jasmine.addMatchers({ | |
toBeAHero: (util, customEqualityMatchers) => { | |
return { | |
compare: (actual, expected) => { | |
return { | |
// heroes are objects that have id, name and strength properties | |
pass: actual && actual.id && actual.name && actual.strength | |
}; | |
} | |
}; | |
} | |
}); | |
}); | |
declare module jasmine { | |
interface Matchers { | |
toBeAHero(): boolean; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment