Created
September 19, 2012 09:47
-
-
Save fantactuka/3748753 to your computer and use it in GitHub Desktop.
Adding jasmine matches in helper outside beforeEach (to speedup)
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
// Hacking Jasmine: adding matchers outside beforeEach to speed up code | |
jasmine.addMatchers = function(matchers) { | |
var parentClass = jasmine.getEnv().matchersClass; | |
var matchersClass = function() { | |
parentClass.apply(this, arguments); | |
}; | |
jasmine.util.inherit(matchersClass, parentClass); | |
jasmine.Matchers.wrapInto_(matchers, matchersClass); | |
jasmine.getEnv().matchersClass = matchersClass; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment