Socket
Socket
Sign inDemoInstall

expect

Package Overview
Dependencies
25
Maintainers
1
Versions
236
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.11.0 to 1.11.1

14

lib/SpyUtils.js

@@ -21,2 +21,4 @@ 'use strict';

function createSpy(fn) {
var destroy = arguments.length <= 1 || arguments[1] === undefined ? noop : arguments[1];
if (fn == null) fn = noop;

@@ -68,2 +70,4 @@

spy.destroy = spy.restore = destroy;
spy.__isSpy = true;

@@ -77,10 +81,6 @@

if (original == null || !original.__isSpy) {
var spy = createSpy(original);
spy.restore = spy.destroy = function () {
if (!isSpy(original)) {
object[methodName] = createSpy(original, function () {
object[methodName] = original;
};
object[methodName] = spy;
});
}

@@ -87,0 +87,0 @@

@@ -6,3 +6,3 @@ import invariant from './invariant'

export function createSpy(fn) {
export function createSpy(fn, destroy=noop) {
if (fn == null)

@@ -58,2 +58,4 @@ fn = noop

spy.destroy = spy.restore = destroy
spy.__isSpy = true

@@ -67,10 +69,6 @@

if (original == null || !original.__isSpy) {
const spy = createSpy(original)
spy.restore = spy.destroy = function () {
if (!isSpy(original)) {
object[methodName] = createSpy(original, function () {
object[methodName] = original
}
object[methodName] = spy
})
}

@@ -77,0 +75,0 @@

{
"name": "expect",
"version": "1.11.0",
"version": "1.11.1",
"description": "Write better assertions",

@@ -5,0 +5,0 @@ "main": "lib/index",

@@ -824,2 +824,4 @@ (function webpackUniversalModuleDefinition(root, factory) {

function createSpy(fn) {
var destroy = arguments.length <= 1 || arguments[1] === undefined ? noop : arguments[1];
if (fn == null) fn = noop;

@@ -871,2 +873,4 @@

spy.destroy = spy.restore = destroy;
spy.__isSpy = true;

@@ -880,10 +884,6 @@

if (original == null || !original.__isSpy) {
var spy = createSpy(original);
spy.restore = spy.destroy = function () {
if (!isSpy(original)) {
object[methodName] = createSpy(original, function () {
object[methodName] = original;
};
object[methodName] = spy;
});
}

@@ -890,0 +890,0 @@

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.expect=e():t.expect=e()}(this,function(){return function(t){function e(u){if(n[u])return n[u].exports;var a=n[u]={exports:{},id:u,loaded:!1};return t[u].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t){return new o["default"](t)}e.__esModule=!0;var r=n(5),o=u(r),i=n(2);a.createSpy=i.createSpy,a.spyOn=i.spyOn,a.isSpy=i.isSpy,e["default"]=a,t.exports=e["default"]},function(t,e){"use strict";function n(t){return"function"==typeof t}e.__esModule=!0,e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(){}function r(t){null==t&&(t=a),c["default"](f["default"](t),"createSpy needs a function");var e=void 0,n=void 0,u=void 0,r=function o(){if(o.calls.push({context:this,arguments:Array.prototype.slice.call(arguments,0)}),e)return e.apply(this,arguments);if(n)throw n;return u};return r.calls=[],r.andCall=function(t){return e=t,r},r.andCallThrough=function(){return r.andCall(t)},r.andThrow=function(t){return n=t,r},r.andReturn=function(t){return u=t,r},r.getLastCall=function(){return r.calls[r.calls.length-1]},r.__isSpy=!0,r}function o(t,e){var n=t[e];if(null==n||!n.__isSpy){var u=r(n);u.restore=u.destroy=function(){t[e]=n},t[e]=u}return t[e]}function i(t){return t&&t.__isSpy===!0}e.__esModule=!0,e.createSpy=r,e.spyOn=o,e.isSpy=i;var l=n(3),c=u(l),s=n(1),f=u(s)},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!t){var n=Array.prototype.slice.call(arguments,2),u=0;throw new Error(e.replace(/%s/g,function(){return o["default"](n[u++])}))}}e.__esModule=!0;var r=n(13),o=u(r);e["default"]=a,t.exports=e["default"]},function(t,e){"use strict";t.exports=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var r=n(10),o=u(r),i=n(4),l=u(i),c=n(3),s=u(c),f=n(1),p=u(f),h=n(7),d=u(h),y=n(9),g=u(y),m=n(6),x=u(m),b=n(2),v=n(8),T=u(v),_=Array.isArray,E=function(){function t(e){a(this,t),this.actual=e,p["default"](e)&&(this.context=null,this.args=[])}return t.prototype.toExist=function(t){return s["default"](this.actual,t||"Expected %s to exist",this.actual),this},t.prototype.toNotExist=function(t){return s["default"](!this.actual,t||"Expected %s to not exist",this.actual),this},t.prototype.toBe=function(t,e){return s["default"](this.actual===t,e||"Expected %s to be %s",this.actual,t),this},t.prototype.toNotBe=function(t,e){return s["default"](this.actual!==t,e||"Expected %s to not be %s",this.actual,t),this},t.prototype.toEqual=function(t,e){return s["default"](o["default"](this.actual,t),e||"Expected %s to equal %s",this.actual,t),this},t.prototype.toNotEqual=function(t,e){return s["default"](!o["default"](this.actual,t),e||"Expected %s to not equal %s",this.actual,t),this},t.prototype.toThrow=function(t,e){return s["default"](p["default"](this.actual),'The "actual" argument in expect(actual).toThrow() must be a function, %s was given',this.actual),s["default"](d["default"](this.actual,this.context,this.args,t),e||"Expected %s to throw %s",this.actual,t),this},t.prototype.toNotThrow=function(t,e){return s["default"](p["default"](this.actual),'The "actual" argument in expect(actual).toNotThrow() must be a function, %s was given',this.actual),s["default"](!d["default"](this.actual,this.context,this.args,t),e||"Expected %s to not throw %s",this.actual,t),this},t.prototype.toBeA=function(t,e){return s["default"](p["default"](t)||"string"==typeof t,'The "value" argument in toBeA(value) must be a function or a string'),s["default"](T["default"](this.actual,t),e||"Expected %s to be a %s",this.actual,t),this},t.prototype.toNotBeA=function(t,e){return s["default"](p["default"](t)||"string"==typeof t,'The "value" argument in toNotBeA(value) must be a function or a string'),s["default"](!T["default"](this.actual,t),e||"Expected %s to be a %s",this.actual,t),this},t.prototype.toMatch=function(t,e){return s["default"]("string"==typeof this.actual,'The "actual" argument in expect(actual).toMatch() must be a string'),s["default"](l["default"](t),'The "value" argument in toMatch(value) must be a RegExp'),s["default"](t.test(this.actual),e||"Expected %s to match %s",this.actual,t),this},t.prototype.toNotMatch=function(t,e){return s["default"]("string"==typeof this.actual,'The "actual" argument in expect(actual).toNotMatch() must be a string'),s["default"](l["default"](t),'The "value" argument in toNotMatch(value) must be a RegExp'),s["default"](!t.test(this.actual),e||"Expected %s to not match %s",this.actual,t),this},t.prototype.toBeLessThan=function(t,e){return s["default"]("number"==typeof this.actual,'The "actual" argument in expect(actual).toBeLessThan() must be a number'),s["default"]("number"==typeof t,'The "value" argument in toBeLessThan(value) must be a number'),s["default"](this.actual<t,e||"Expected %s to be less than %s",this.actual,t),this},t.prototype.toBeGreaterThan=function(t,e){return s["default"]("number"==typeof this.actual,'The "actual" argument in expect(actual).toBeGreaterThan() must be a number'),s["default"]("number"==typeof t,'The "value" argument in toBeGreaterThan(value) must be a number'),s["default"](this.actual>t,e||"Expected %s to be greater than %s",this.actual,t),this},t.prototype.toInclude=function(t,e,n){return s["default"](_(this.actual)||"string"==typeof this.actual,'The "actual" argument in expect(actual).toInclude() must be an array or a string'),"string"==typeof e&&(n=e,e=null),n=n||"Expected %s to include %s",_(this.actual)?s["default"](x["default"](this.actual,t,e),n,this.actual,t):s["default"](g["default"](this.actual,t),n,this.actual,t),this},t.prototype.toExclude=function(t,e,n){return s["default"](_(this.actual)||"string"==typeof this.actual,'The "actual" argument in expect(actual).toExclude() must be an array or a string'),"string"==typeof e&&(n=e,e=null),n=n||"Expected %s to exclude %s",_(this.actual)?s["default"](!x["default"](this.actual,t,e),n,this.actual,t):s["default"](!g["default"](this.actual,t),n,this.actual,t),this},t.prototype.toHaveBeenCalled=function(t){var e=this.actual;return s["default"](b.isSpy(e),'The "actual" argument in expect(actual).toHaveBeenCalled() must be a spy'),s["default"](e.calls.length>0,t||"spy was not called"),this},t.prototype.toHaveBeenCalledWith=function(){var t=this.actual;s["default"](b.isSpy(t),'The "actual" argument in expect(actual).toHaveBeenCalledWith() must be a spy');var e=Array.prototype.slice.call(arguments,0);return s["default"](t.calls.some(function(t){return o["default"](t.arguments,e)}),"spy was never called with %s",e),this},t.prototype.toNotHaveBeenCalled=function(t){var e=this.actual;return s["default"](b.isSpy(e),'The "actual" argument in expect(actual).toNotHaveBeenCalled() must be a spy'),s["default"](0===e.calls.length,t||"spy was not supposed to be called"),this},t.prototype.withContext=function(t){return s["default"](p["default"](this.actual),'The "actual" argument in expect(actual).withContext() must be a function'),this.context=t,this},t.prototype.withArgs=function(){return s["default"](p["default"](this.actual),'The "actual" argument in expect(actual).withArgs() must be a function'),arguments.length&&(this.args=this.args.concat(Array.prototype.slice.call(arguments,0))),this},t}(),j={toBeAn:"toBeA",toNotBeAn:"toNotBeA",toBeTruthy:"toExist",toBeFalsy:"toNotExist",toBeFewerThan:"toBeLessThan",toBeMoreThan:"toBeGreaterThan",toContain:"toInclude",toNotContain:"toExclude"};for(var w in j)E.prototype[w]=E.prototype[j[w]];e["default"]=E,t.exports=e["default"]},function(t,e){"use strict";function n(t,e,n){return null==n?-1!==t.indexOf(e):t.some(function(t){return n(t,e)!==!1})}e.__esModule=!0,e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t,e,n,u){try{t.apply(e,n)}catch(a){if(null==u)return!0;if(l["default"](u)&&a instanceof u)return!0;var r=a.message||a;if("string"==typeof r){if(o["default"](u)&&u.test(a.message))return!0;if("string"==typeof u&&-1!==r.indexOf(u))return!0}}return!1}e.__esModule=!0;var r=n(4),o=u(r),i=n(1),l=u(i);e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){return o["default"](e)?t instanceof e:"array"===e?Array.isArray(t):typeof t===e}e.__esModule=!0;var r=n(1),o=u(r);e["default"]=a,t.exports=e["default"]},function(t,e){"use strict";function n(t,e){return-1!==t.indexOf(e)}e.__esModule=!0,e["default"]=n,t.exports=e["default"]},function(t,e,n){function u(t){return null===t||void 0===t}function a(t){return t&&"object"==typeof t&&"number"==typeof t.length?"function"!=typeof t.copy||"function"!=typeof t.slice?!1:t.length>0&&"number"!=typeof t[0]?!1:!0:!1}function r(t,e,n){var r,s;if(u(t)||u(e))return!1;if(t.prototype!==e.prototype)return!1;if(l(t))return l(e)?(t=o.call(t),e=o.call(e),c(t,e,n)):!1;if(a(t)){if(!a(e))return!1;if(t.length!==e.length)return!1;for(r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}try{var f=i(t),p=i(e)}catch(h){return!1}if(f.length!=p.length)return!1;for(f.sort(),p.sort(),r=f.length-1;r>=0;r--)if(f[r]!=p[r])return!1;for(r=f.length-1;r>=0;r--)if(s=f[r],!c(t[s],e[s],n))return!1;return typeof t==typeof e}var o=Array.prototype.slice,i=n(12),l=n(11),c=t.exports=function(t,e,n){return n||(n={}),t===e?!0:t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:r(t,e,n)}},function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function u(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var a="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();e=t.exports=a?n:u,e.supported=n,e.unsupported=u},function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}e=t.exports="function"==typeof Object.keys?Object.keys:n,e.shim=n},function(t,e){function n(t){return String(t).replace(/"/g,"&quot;")}function u(t){return"[object Array]"===c(t)}function a(t){return"[object Date]"===c(t)}function r(t){return"[object RegExp]"===c(t)}function o(t){return"[object Error]"===c(t)}function i(t){return"[object Symbol]"===c(t)}function l(t,e){return d.call(t,e)}function c(t){return Object.prototype.toString.call(t)}function s(t){if(t.name)return t.name;var e=t.toString().match(/^function\s*([\w$]+)/);return e?e[1]:void 0}function f(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,u=t.length;u>n;n++)if(t[n]===e)return n;return-1}function p(t){return t&&"object"==typeof t?"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?!0:"string"==typeof t.nodeName&&"function"==typeof t.getAttribute:!1}function h(t){function e(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(16>e?"0":"")+e.toString(16)}var n=t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,e);return"'"+n+"'"}t.exports=function y(t,e,c,d){function g(t,n){return n&&(d=d.slice(),d.push(n)),y(t,e,c+1,d)}e||(e={});var m=void 0===e.depth?5:e.depth;if(void 0===c&&(c=0),c>=m&&m>0&&t&&"object"==typeof t)return"[Object]";if(void 0===d)d=[];else if(f(d,t)>=0)return"[Circular]";if("string"==typeof t)return h(t);if("function"==typeof t){var x=s(t);return"[Function"+(x?": "+x:"")+"]"}if(null===t)return"null";if(i(t)){var b=Symbol.prototype.toString.call(t);return"object"==typeof t?"Object("+b+")":b}if(p(t)){for(var v="<"+String(t.nodeName).toLowerCase(),T=t.attributes||[],_=0;_<T.length;_++)v+=" "+T[_].name+'="'+n(T[_].value)+'"';return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+String(t.nodeName).toLowerCase()+">"}if(u(t)){if(0===t.length)return"[]";for(var E=Array(t.length),_=0;_<t.length;_++)E[_]=l(t,_)?g(t[_],t):"";return"[ "+E.join(", ")+" ]"}if(o(t)){var j=[];for(var w in t)l(t,w)&&(/[^\w$]/.test(w)?j.push(g(w)+": "+g(t[w])):j.push(w+": "+g(t[w])));return 0===j.length?"["+t+"]":"{ ["+t+"] "+j.join(", ")+" }"}if("object"==typeof t&&"function"==typeof t.inspect)return t.inspect();if("object"!=typeof t||a(t)||r(t))return String(t);var E=[],B=[];for(var w in t)l(t,w)&&B.push(w);B.sort();for(var _=0;_<B.length;_++){var w=B[_];/[^\w$]/.test(w)?E.push(g(w)+": "+g(t[w],t)):E.push(w+": "+g(t[w],t))}return 0===E.length?"{}":"{ "+E.join(", ")+" }"};var d=Object.prototype.hasOwnProperty||function(t){return t in this}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.expect=e():t.expect=e()}(this,function(){return function(t){function e(u){if(n[u])return n[u].exports;var a=n[u]={exports:{},id:u,loaded:!1};return t[u].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t){return new o["default"](t)}e.__esModule=!0;var r=n(5),o=u(r),i=n(2);a.createSpy=i.createSpy,a.spyOn=i.spyOn,a.isSpy=i.isSpy,e["default"]=a,t.exports=e["default"]},function(t,e){"use strict";function n(t){return"function"==typeof t}e.__esModule=!0,e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(){}function r(t){var e=arguments.length<=1||void 0===arguments[1]?a:arguments[1];null==t&&(t=a),c["default"](f["default"](t),"createSpy needs a function");var n=void 0,u=void 0,r=void 0,o=function i(){if(i.calls.push({context:this,arguments:Array.prototype.slice.call(arguments,0)}),n)return n.apply(this,arguments);if(u)throw u;return r};return o.calls=[],o.andCall=function(t){return n=t,o},o.andCallThrough=function(){return o.andCall(t)},o.andThrow=function(t){return u=t,o},o.andReturn=function(t){return r=t,o},o.getLastCall=function(){return o.calls[o.calls.length-1]},o.destroy=o.restore=e,o.__isSpy=!0,o}function o(t,e){var n=t[e];return i(n)||(t[e]=r(n,function(){t[e]=n})),t[e]}function i(t){return t&&t.__isSpy===!0}e.__esModule=!0,e.createSpy=r,e.spyOn=o,e.isSpy=i;var l=n(3),c=u(l),s=n(1),f=u(s)},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!t){var n=Array.prototype.slice.call(arguments,2),u=0;throw new Error(e.replace(/%s/g,function(){return o["default"](n[u++])}))}}e.__esModule=!0;var r=n(13),o=u(r);e["default"]=a,t.exports=e["default"]},function(t,e){"use strict";t.exports=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var r=n(10),o=u(r),i=n(4),l=u(i),c=n(3),s=u(c),f=n(1),p=u(f),h=n(7),d=u(h),y=n(9),g=u(y),m=n(6),x=u(m),b=n(2),v=n(8),T=u(v),E=Array.isArray,j=function(){function t(e){a(this,t),this.actual=e,p["default"](e)&&(this.context=null,this.args=[])}return t.prototype.toExist=function(t){return s["default"](this.actual,t||"Expected %s to exist",this.actual),this},t.prototype.toNotExist=function(t){return s["default"](!this.actual,t||"Expected %s to not exist",this.actual),this},t.prototype.toBe=function(t,e){return s["default"](this.actual===t,e||"Expected %s to be %s",this.actual,t),this},t.prototype.toNotBe=function(t,e){return s["default"](this.actual!==t,e||"Expected %s to not be %s",this.actual,t),this},t.prototype.toEqual=function(t,e){return s["default"](o["default"](this.actual,t),e||"Expected %s to equal %s",this.actual,t),this},t.prototype.toNotEqual=function(t,e){return s["default"](!o["default"](this.actual,t),e||"Expected %s to not equal %s",this.actual,t),this},t.prototype.toThrow=function(t,e){return s["default"](p["default"](this.actual),'The "actual" argument in expect(actual).toThrow() must be a function, %s was given',this.actual),s["default"](d["default"](this.actual,this.context,this.args,t),e||"Expected %s to throw %s",this.actual,t),this},t.prototype.toNotThrow=function(t,e){return s["default"](p["default"](this.actual),'The "actual" argument in expect(actual).toNotThrow() must be a function, %s was given',this.actual),s["default"](!d["default"](this.actual,this.context,this.args,t),e||"Expected %s to not throw %s",this.actual,t),this},t.prototype.toBeA=function(t,e){return s["default"](p["default"](t)||"string"==typeof t,'The "value" argument in toBeA(value) must be a function or a string'),s["default"](T["default"](this.actual,t),e||"Expected %s to be a %s",this.actual,t),this},t.prototype.toNotBeA=function(t,e){return s["default"](p["default"](t)||"string"==typeof t,'The "value" argument in toNotBeA(value) must be a function or a string'),s["default"](!T["default"](this.actual,t),e||"Expected %s to be a %s",this.actual,t),this},t.prototype.toMatch=function(t,e){return s["default"]("string"==typeof this.actual,'The "actual" argument in expect(actual).toMatch() must be a string'),s["default"](l["default"](t),'The "value" argument in toMatch(value) must be a RegExp'),s["default"](t.test(this.actual),e||"Expected %s to match %s",this.actual,t),this},t.prototype.toNotMatch=function(t,e){return s["default"]("string"==typeof this.actual,'The "actual" argument in expect(actual).toNotMatch() must be a string'),s["default"](l["default"](t),'The "value" argument in toNotMatch(value) must be a RegExp'),s["default"](!t.test(this.actual),e||"Expected %s to not match %s",this.actual,t),this},t.prototype.toBeLessThan=function(t,e){return s["default"]("number"==typeof this.actual,'The "actual" argument in expect(actual).toBeLessThan() must be a number'),s["default"]("number"==typeof t,'The "value" argument in toBeLessThan(value) must be a number'),s["default"](this.actual<t,e||"Expected %s to be less than %s",this.actual,t),this},t.prototype.toBeGreaterThan=function(t,e){return s["default"]("number"==typeof this.actual,'The "actual" argument in expect(actual).toBeGreaterThan() must be a number'),s["default"]("number"==typeof t,'The "value" argument in toBeGreaterThan(value) must be a number'),s["default"](this.actual>t,e||"Expected %s to be greater than %s",this.actual,t),this},t.prototype.toInclude=function(t,e,n){return s["default"](E(this.actual)||"string"==typeof this.actual,'The "actual" argument in expect(actual).toInclude() must be an array or a string'),"string"==typeof e&&(n=e,e=null),n=n||"Expected %s to include %s",E(this.actual)?s["default"](x["default"](this.actual,t,e),n,this.actual,t):s["default"](g["default"](this.actual,t),n,this.actual,t),this},t.prototype.toExclude=function(t,e,n){return s["default"](E(this.actual)||"string"==typeof this.actual,'The "actual" argument in expect(actual).toExclude() must be an array or a string'),"string"==typeof e&&(n=e,e=null),n=n||"Expected %s to exclude %s",E(this.actual)?s["default"](!x["default"](this.actual,t,e),n,this.actual,t):s["default"](!g["default"](this.actual,t),n,this.actual,t),this},t.prototype.toHaveBeenCalled=function(t){var e=this.actual;return s["default"](b.isSpy(e),'The "actual" argument in expect(actual).toHaveBeenCalled() must be a spy'),s["default"](e.calls.length>0,t||"spy was not called"),this},t.prototype.toHaveBeenCalledWith=function(){var t=this.actual;s["default"](b.isSpy(t),'The "actual" argument in expect(actual).toHaveBeenCalledWith() must be a spy');var e=Array.prototype.slice.call(arguments,0);return s["default"](t.calls.some(function(t){return o["default"](t.arguments,e)}),"spy was never called with %s",e),this},t.prototype.toNotHaveBeenCalled=function(t){var e=this.actual;return s["default"](b.isSpy(e),'The "actual" argument in expect(actual).toNotHaveBeenCalled() must be a spy'),s["default"](0===e.calls.length,t||"spy was not supposed to be called"),this},t.prototype.withContext=function(t){return s["default"](p["default"](this.actual),'The "actual" argument in expect(actual).withContext() must be a function'),this.context=t,this},t.prototype.withArgs=function(){return s["default"](p["default"](this.actual),'The "actual" argument in expect(actual).withArgs() must be a function'),arguments.length&&(this.args=this.args.concat(Array.prototype.slice.call(arguments,0))),this},t}(),_={toBeAn:"toBeA",toNotBeAn:"toNotBeA",toBeTruthy:"toExist",toBeFalsy:"toNotExist",toBeFewerThan:"toBeLessThan",toBeMoreThan:"toBeGreaterThan",toContain:"toInclude",toNotContain:"toExclude"};for(var w in _)j.prototype[w]=j.prototype[_[w]];e["default"]=j,t.exports=e["default"]},function(t,e){"use strict";function n(t,e,n){return null==n?-1!==t.indexOf(e):t.some(function(t){return n(t,e)!==!1})}e.__esModule=!0,e["default"]=n,t.exports=e["default"]},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t,e,n,u){try{t.apply(e,n)}catch(a){if(null==u)return!0;if(l["default"](u)&&a instanceof u)return!0;var r=a.message||a;if("string"==typeof r){if(o["default"](u)&&u.test(a.message))return!0;if("string"==typeof u&&-1!==r.indexOf(u))return!0}}return!1}e.__esModule=!0;var r=n(4),o=u(r),i=n(1),l=u(i);e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";function u(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){return o["default"](e)?t instanceof e:"array"===e?Array.isArray(t):typeof t===e}e.__esModule=!0;var r=n(1),o=u(r);e["default"]=a,t.exports=e["default"]},function(t,e){"use strict";function n(t,e){return-1!==t.indexOf(e)}e.__esModule=!0,e["default"]=n,t.exports=e["default"]},function(t,e,n){function u(t){return null===t||void 0===t}function a(t){return t&&"object"==typeof t&&"number"==typeof t.length?"function"!=typeof t.copy||"function"!=typeof t.slice?!1:t.length>0&&"number"!=typeof t[0]?!1:!0:!1}function r(t,e,n){var r,s;if(u(t)||u(e))return!1;if(t.prototype!==e.prototype)return!1;if(l(t))return l(e)?(t=o.call(t),e=o.call(e),c(t,e,n)):!1;if(a(t)){if(!a(e))return!1;if(t.length!==e.length)return!1;for(r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}try{var f=i(t),p=i(e)}catch(h){return!1}if(f.length!=p.length)return!1;for(f.sort(),p.sort(),r=f.length-1;r>=0;r--)if(f[r]!=p[r])return!1;for(r=f.length-1;r>=0;r--)if(s=f[r],!c(t[s],e[s],n))return!1;return typeof t==typeof e}var o=Array.prototype.slice,i=n(12),l=n(11),c=t.exports=function(t,e,n){return n||(n={}),t===e?!0:t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:r(t,e,n)}},function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function u(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var a="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();e=t.exports=a?n:u,e.supported=n,e.unsupported=u},function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}e=t.exports="function"==typeof Object.keys?Object.keys:n,e.shim=n},function(t,e){function n(t){return String(t).replace(/"/g,"&quot;")}function u(t){return"[object Array]"===c(t)}function a(t){return"[object Date]"===c(t)}function r(t){return"[object RegExp]"===c(t)}function o(t){return"[object Error]"===c(t)}function i(t){return"[object Symbol]"===c(t)}function l(t,e){return d.call(t,e)}function c(t){return Object.prototype.toString.call(t)}function s(t){if(t.name)return t.name;var e=t.toString().match(/^function\s*([\w$]+)/);return e?e[1]:void 0}function f(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,u=t.length;u>n;n++)if(t[n]===e)return n;return-1}function p(t){return t&&"object"==typeof t?"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?!0:"string"==typeof t.nodeName&&"function"==typeof t.getAttribute:!1}function h(t){function e(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(16>e?"0":"")+e.toString(16)}var n=t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,e);return"'"+n+"'"}t.exports=function y(t,e,c,d){function g(t,n){return n&&(d=d.slice(),d.push(n)),y(t,e,c+1,d)}e||(e={});var m=void 0===e.depth?5:e.depth;if(void 0===c&&(c=0),c>=m&&m>0&&t&&"object"==typeof t)return"[Object]";if(void 0===d)d=[];else if(f(d,t)>=0)return"[Circular]";if("string"==typeof t)return h(t);if("function"==typeof t){var x=s(t);return"[Function"+(x?": "+x:"")+"]"}if(null===t)return"null";if(i(t)){var b=Symbol.prototype.toString.call(t);return"object"==typeof t?"Object("+b+")":b}if(p(t)){for(var v="<"+String(t.nodeName).toLowerCase(),T=t.attributes||[],E=0;E<T.length;E++)v+=" "+T[E].name+'="'+n(T[E].value)+'"';return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+String(t.nodeName).toLowerCase()+">"}if(u(t)){if(0===t.length)return"[]";for(var j=Array(t.length),E=0;E<t.length;E++)j[E]=l(t,E)?g(t[E],t):"";return"[ "+j.join(", ")+" ]"}if(o(t)){var _=[];for(var w in t)l(t,w)&&(/[^\w$]/.test(w)?_.push(g(w)+": "+g(t[w])):_.push(w+": "+g(t[w])));return 0===_.length?"["+t+"]":"{ ["+t+"] "+_.join(", ")+" }"}if("object"==typeof t&&"function"==typeof t.inspect)return t.inspect();if("object"!=typeof t||a(t)||r(t))return String(t);var j=[],B=[];for(var w in t)l(t,w)&&B.push(w);B.sort();for(var E=0;E<B.length;E++){var w=B[E];/[^\w$]/.test(w)?j.push(g(w)+": "+g(t[w],t)):j.push(w+": "+g(t[w],t))}return 0===j.length?"{}":"{ "+j.join(", ")+" }"};var d=Object.prototype.hasOwnProperty||function(t){return t in this}}])});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc