Promise-based strategies are now named resolveWith and rejectWith

This commit is contained in:
Elliot Nelson
2019-05-09 06:12:06 -04:00
parent df818f3fbc
commit b2fb92eedd
3 changed files with 17 additions and 17 deletions

View File

@@ -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() {