Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

View File

@@ -50,11 +50,13 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* eslint-disable local/ban-types-eventually, local/prefer-rest-params-eventually */
class SpyStrategy {
constructor({
name = 'unknown',
fn = function() {},
getSpy = function() {}
fn = function () {},
getSpy = function () {}
} = {}) {
_defineProperty(this, 'identity', void 0);
@@ -75,51 +77,51 @@ class SpyStrategy {
const identity = name;
const originalFn = fn;
let plan = function plan() {};
let plan = function () {};
this.identity = function() {
this.identity = function () {
return identity;
};
this.exec = function() {
this.exec = function () {
return plan.apply(this, arguments);
};
this.callThrough = function() {
this.callThrough = function () {
plan = originalFn;
return getSpy();
};
this.returnValue = function(value) {
plan = function plan() {
this.returnValue = function (value) {
plan = function () {
return value;
};
return getSpy();
};
this.returnValues = function() {
this.returnValues = function () {
const values = Array.prototype.slice.call(arguments);
plan = function plan() {
plan = function () {
return values.shift();
};
return getSpy();
};
this.throwError = function(something) {
this.throwError = function (something) {
const error =
something instanceof Error ? something : new Error(something);
plan = function plan() {
plan = function () {
throw error;
};
return getSpy();
};
this.callFake = function(fn) {
this.callFake = function (fn) {
if (typeof fn !== 'function') {
throw new Error(
'Argument passed to callFake should be a function, got ' + fn
@@ -130,8 +132,8 @@ class SpyStrategy {
return getSpy();
};
this.stub = function(_fn) {
plan = function plan() {};
this.stub = function (_fn) {
plan = function () {};
return getSpy();
};