Skip to content

Instantly share code, notes, and snippets.

@m4nuC
Created November 10, 2012 22:56
Show Gist options
  • Save m4nuC/4052863 to your computer and use it in GitHub Desktop.
Save m4nuC/4052863 to your computer and use it in GitHub Desktop.
Jasmine Object instance Matchers and typeof matcher
beforeEach(function() {
this.addMatchers({
toBeInstanceOf : function( expected ) {
return this.actual instanceof expected && this.actual.length > 0;
},
toBeA: function( expected ) {
return typeof this.actual === expected;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment