Promise-based strategies are now named resolveWith and rejectWith
This commit is contained in:
@@ -40,12 +40,12 @@ getJasmineRequireObj().SpyStrategy = function(j$) {
|
||||
|
||||
/**
|
||||
* Tell the spy to return a promise resolving to the specified value when invoked.
|
||||
* @name SpyStrategy#resolveValue
|
||||
* @name SpyStrategy#resolveWith
|
||||
* @function
|
||||
* @param {*} value The value to return.
|
||||
*/
|
||||
this.resolveValue = function(value) {
|
||||
var Promise = requirePromise('resolveValue');
|
||||
this.resolveWith = function(value) {
|
||||
var Promise = requirePromise('resolveWith');
|
||||
self.plan = function() {
|
||||
return Promise.resolve(value);
|
||||
};
|
||||
@@ -54,12 +54,12 @@ getJasmineRequireObj().SpyStrategy = function(j$) {
|
||||
|
||||
/**
|
||||
* Tell the spy to return a promise rejecting with the specified value when invoked.
|
||||
* @name SpyStrategy#rejectValue
|
||||
* @name SpyStrategy#rejectWith
|
||||
* @function
|
||||
* @param {*} value The value to return.
|
||||
*/
|
||||
this.rejectValue = function(value) {
|
||||
var Promise = requirePromise('rejectValue');
|
||||
this.rejectWith = function(value) {
|
||||
var Promise = requirePromise('rejectWith');
|
||||
var error = (value instanceof Error) ? value : new Error(value);
|
||||
|
||||
self.plan = function() {
|
||||
|
||||
Reference in New Issue
Block a user