Skip to content

Instantly share code, notes, and snippets.

@joeeames
Created November 6, 2017 11:19
Show Gist options
  • Save joeeames/3fb07e9088f61bbe2c324184442858ec to your computer and use it in GitHub Desktop.
Save joeeames/3fb07e9088f61bbe2c324184442858ec to your computer and use it in GitHub Desktop.
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