Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mallowigi/eb45f08f06420b25d9ef to your computer and use it in GitHub Desktop.
Save mallowigi/eb45f08f06420b25d9ef to your computer and use it in GitHub Desktop.
beforeEach(function() {
this.addMatchers({
toBeInstanceOf: function(expectedInstance) {
var actual = this.actual;
var notText = this.isNot ? " not" : "";
this.message = function() {
return "Expected " + actual.constructor.name + notText + " is instance of " + expectedInstance.name;
};
return actual instanceof expectedInstance;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment