Use arrow fns rather than self = this

This commit is contained in:
Steve Gravrock
2022-06-11 11:54:09 -07:00
parent e2e2275d41
commit 96000220b1
10 changed files with 436 additions and 458 deletions

View File

@@ -5,8 +5,6 @@ getJasmineRequireObj().SpyStrategy = function(j$) {
function SpyStrategy(options) {
options = options || {};
const self = this;
/**
* Get the identifying information for the spy.
* @name SpyStrategy#identity
@@ -34,10 +32,10 @@ getJasmineRequireObj().SpyStrategy = function(j$) {
* @param {*} value The value to return.
*/
this.resolveTo = function(value) {
self.plan = function() {
this.plan = function() {
return Promise.resolve(value);
};
return self.getSpy();
return this.getSpy();
};
/**
@@ -48,10 +46,10 @@ getJasmineRequireObj().SpyStrategy = function(j$) {
* @param {*} value The value to return.
*/
this.rejectWith = function(value) {
self.plan = function() {
this.plan = function() {
return Promise.reject(value);
};
return self.getSpy();
return this.getSpy();
};
}