-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspec_helper.js
More file actions
26 lines (24 loc) · 832 Bytes
/
spec_helper.js
File metadata and controls
26 lines (24 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
beforeEach(function() {
this.addMatchers(/** @lends {jasmine.Matcher.prototype } */ ({
toPromiseSuccess: function(callbackExpectation) {
var callbackFired = false;
var wrappedCallback = function() {
callbackFired = true;
callbackExpectation.apply(this, arguments);
}
expect(this.actual).toEqual(jasmine.any(jssip.async.Promise));
this.actual.then(wrappedCallback);
return callbackFired;
},
toPromiseError: function(errbackExpectation) {
var callbackFired = false;
var wrappedErrback = function() {
callbackFired = true;
errbackExpectation.apply(this, arguments);
}
expect(this.actual).toEqual(jasmine.any(jssip.async.Promise));
this.actual.then(undefined, wrappedErrback);
return callbackFired;
}
}));
});