Pull async matchers out to their own functions

- Makes AsyncExpectation closer to Expectation
This commit is contained in:
Gregg Van Hove
2018-10-23 16:02:31 -07:00
parent ba1e8f8008
commit 1e47dcf2cc
15 changed files with 566 additions and 617 deletions
+16
View File
@@ -0,0 +1,16 @@
getJasmineRequireObj().requireAsyncMatchers = function(jRequire, j$) {
var availableMatchers = [
'toBeResolved',
'toBeRejected',
'toBeResolvedTo',
'toBeRejectedWith'
],
matchers = {};
for (var i = 0; i < availableMatchers.length; i++) {
var name = availableMatchers[i];
matchers[name] = jRequire[name](j$);
}
return matchers;
};