UNPKG

direct-dev

Version:
1 lines 751 kB
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.sinon=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";exports.assert=require("./sinon/assert");exports.collection=require("./sinon/collection");exports.match=require("./sinon/match");exports.spy=require("./sinon/spy");exports.spyCall=require("./sinon/call");exports.stub=require("./sinon/stub");exports.mock=require("./sinon/mock");var sandbox=require("./sinon/sandbox");exports.sandbox=sandbox;exports.expectation=require("./sinon/mock-expectation");exports.createStubInstance=require("./sinon/stub").createStubInstance;exports.defaultConfig=require("./sinon/util/core/default-config");var fakeTimers=require("./sinon/util/fake_timers");exports.useFakeTimers=fakeTimers.useFakeTimers;exports.clock=fakeTimers.clock;exports.timers=fakeTimers.timers;var nise=require("nise");exports.xhr=nise.fakeXhr.xhr;exports.FakeXMLHttpRequest=nise.fakeXhr.FakeXMLHttpRequest;exports.useFakeXMLHttpRequest=nise.fakeXhr.useFakeXMLHttpRequest;exports.fakeServer=nise.fakeServer;exports.fakeServerWithClock=nise.fakeServerWithClock;exports.createSandbox=sandbox.create;exports.createFakeServer=nise.fakeServer.create.bind(nise.fakeServer);exports.createFakeServerWithClock=nise.fakeServerWithClock.create.bind(nise.fakeServerWithClock);var behavior=require("./sinon/behavior");exports.addBehavior=function(name,fn){behavior.addBehavior(exports.stub,name,fn)};var format=require("./sinon/util/core/format");exports.setFormatter=format.setFormatter},{"./sinon/assert":2,"./sinon/behavior":3,"./sinon/call":4,"./sinon/collection":6,"./sinon/match":9,"./sinon/mock":11,"./sinon/mock-expectation":10,"./sinon/sandbox":12,"./sinon/spy":14,"./sinon/stub":16,"./sinon/util/core/default-config":20,"./sinon/util/core/format":23,"./sinon/util/fake_timers":34,nise:52}],2:[function(require,module,exports){(function(global){"use strict";var calledInOrder=require("./util/core/called-in-order");var orderByFirstCall=require("./util/core/order-by-first-call");var timesInWords=require("./util/core/times-in-words");var format=require("./util/core/format");var sinonMatch=require("./match");var slice=Array.prototype.slice;var assert;function verifyIsStub(){var args=Array.prototype.slice.call(arguments);args.forEach(function(method){if(!method){assert.fail("fake is not a spy")}if(method.proxy&&method.proxy.isSinonProxy){verifyIsStub(method.proxy)}else{if(typeof method!=="function"){assert.fail(method+" is not a function")}if(typeof method.getCall!=="function"){assert.fail(method+" is not stubbed")}}})}function verifyIsValidAssertion(assertionMethod,assertionArgs){switch(assertionMethod){case"notCalled":case"called":case"calledOnce":case"calledTwice":case"calledThrice":if(assertionArgs.length!==0){assert.fail(assertionMethod+" takes 1 argument but was called with "+(assertionArgs.length+1)+" arguments")}break;default:break}}function failAssertion(object,msg){object=object||global;var failMethod=object.fail||assert.fail;failMethod.call(object,msg)}function mirrorPropAsAssertion(name,method,message){if(arguments.length===2){message=method;method=name}assert[name]=function(fake){verifyIsStub(fake);var args=slice.call(arguments,1);var failed=false;verifyIsValidAssertion(name,args);if(typeof method==="function"){failed=!method(fake)}else{failed=typeof fake[method]==="function"?!fake[method].apply(fake,args):!fake[method]}if(failed){failAssertion(this,(fake.printf||fake.proxy.printf).apply(fake,[message].concat(args)))}else{assert.pass(name)}}}function exposedName(prefix,prop){return!prefix||/^fail/.test(prop)?prop:prefix+prop.slice(0,1).toUpperCase()+prop.slice(1)}assert={failException:"AssertError",fail:function fail(message){var error=new Error(message);error.name=this.failException||assert.failException;throw error},pass:function pass(){},callOrder:function assertCallOrder(){verifyIsStub.apply(null,arguments);var expected="";var actual="";if(!calledInOrder(arguments)){try{expected=[].join.call(arguments,", ");var calls=slice.call(arguments);var i=calls.length;while(i){if(!calls[--i].called){calls.splice(i,1)}}actual=orderByFirstCall(calls).join(", ")}catch(e){}failAssertion(this,"expected "+expected+" to be "+"called in order but were called as "+actual)}else{assert.pass("callOrder")}},callCount:function assertCallCount(method,count){verifyIsStub(method);if(method.callCount!==count){var msg="expected %n to be called "+timesInWords(count)+" but was called %c%C";failAssertion(this,method.printf(msg))}else{assert.pass("callCount")}},expose:function expose(target,options){if(!target){throw new TypeError("target is null or undefined")}var o=options||{};var prefix=typeof o.prefix==="undefined"&&"assert"||o.prefix;var includeFail=typeof o.includeFail==="undefined"||!!o.includeFail;var instance=this;Object.keys(instance).forEach(function(method){if(method!=="expose"&&(includeFail||!/^(fail)/.test(method))){target[exposedName(prefix,method)]=instance[method]}});return target},match:function match(actual,expectation){var matcher=sinonMatch(expectation);if(matcher.test(actual)){assert.pass("match")}else{var formatted=["expected value to match"," expected = "+format(expectation)," actual = "+format(actual)];failAssertion(this,formatted.join("\n"))}}};mirrorPropAsAssertion("called","expected %n to have been called at least once but was never called");mirrorPropAsAssertion("notCalled",function(spy){return!spy.called},"expected %n to not have been called but was called %c%C");mirrorPropAsAssertion("calledOnce","expected %n to be called once but was called %c%C");mirrorPropAsAssertion("calledTwice","expected %n to be called twice but was called %c%C");mirrorPropAsAssertion("calledThrice","expected %n to be called thrice but was called %c%C");mirrorPropAsAssertion("calledOn","expected %n to be called with %1 as this but was called with %t");mirrorPropAsAssertion("alwaysCalledOn","expected %n to always be called with %1 as this but was called with %t");mirrorPropAsAssertion("calledWithNew","expected %n to be called with new");mirrorPropAsAssertion("alwaysCalledWithNew","expected %n to always be called with new");mirrorPropAsAssertion("calledWith","expected %n to be called with arguments %D");mirrorPropAsAssertion("calledWithMatch","expected %n to be called with match %D");mirrorPropAsAssertion("alwaysCalledWith","expected %n to always be called with arguments %D");mirrorPropAsAssertion("alwaysCalledWithMatch","expected %n to always be called with match %D");mirrorPropAsAssertion("calledWithExactly","expected %n to be called with exact arguments %D");mirrorPropAsAssertion("alwaysCalledWithExactly","expected %n to always be called with exact arguments %D");mirrorPropAsAssertion("neverCalledWith","expected %n to never be called with arguments %*%C");mirrorPropAsAssertion("neverCalledWithMatch","expected %n to never be called with match %*%C");mirrorPropAsAssertion("threw","%n did not throw exception%C");mirrorPropAsAssertion("alwaysThrew","%n did not always throw exception%C");module.exports=assert}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./match":9,"./util/core/called-in-order":18,"./util/core/format":23,"./util/core/order-by-first-call":28,"./util/core/times-in-words":29}],3:[function(require,module,exports){(function(process){"use strict";var extend=require("./util/core/extend");var functionName=require("./util/core/function-name");var valueToString=require("./util/core/value-to-string");var slice=Array.prototype.slice;var join=Array.prototype.join;var useLeftMostCallback=-1;var useRightMostCallback=-2;var nextTick=function(){if(typeof process==="object"&&typeof process.nextTick==="function"){return process.nextTick}if(typeof setImmediate==="function"){return setImmediate}return function(callback){setTimeout(callback,0)}}();function getCallback(behavior,args){var callArgAt=behavior.callArgAt;if(callArgAt>=0){return args[callArgAt]}var argumentList;if(callArgAt===useLeftMostCallback){argumentList=args}if(callArgAt===useRightMostCallback){argumentList=slice.call(args).reverse()}var callArgProp=behavior.callArgProp;for(var i=0,l=argumentList.length;i<l;++i){if(!callArgProp&&typeof argumentList[i]==="function"){return argumentList[i]}if(callArgProp&&argumentList[i]&&typeof argumentList[i][callArgProp]==="function"){return argumentList[i][callArgProp]}}return null}function getCallbackError(behavior,func,args){if(behavior.callArgAt<0){var msg;if(behavior.callArgProp){msg=functionName(behavior.stub)+" expected to yield to '"+valueToString(behavior.callArgProp)+"', but no object with such a property was passed."}else{msg=functionName(behavior.stub)+" expected to yield, but no callback was passed."}if(args.length>0){msg+=" Received ["+join.call(args,", ")+"]"}return msg}return"argument at index "+behavior.callArgAt+" is not a function: "+func}function callCallback(behavior,args){if(typeof behavior.callArgAt==="number"){var func=getCallback(behavior,args);if(typeof func!=="function"){throw new TypeError(getCallbackError(behavior,func,args))}if(behavior.callbackAsync){nextTick(function(){func.apply(behavior.callbackContext,behavior.callbackArguments)})}else{func.apply(behavior.callbackContext,behavior.callbackArguments)}}}var proto={create:function create(stub){var behavior=extend({},proto);delete behavior.create;delete behavior.addBehavior;delete behavior.createBehavior;behavior.stub=stub;if(stub.defaultBehavior&&stub.defaultBehavior.promiseLibrary){behavior.promiseLibrary=stub.defaultBehavior.promiseLibrary}return behavior},isPresent:function isPresent(){return typeof this.callArgAt==="number"||this.exception||this.exceptionCreator||typeof this.returnArgAt==="number"||this.returnThis||this.resolveThis||typeof this.throwArgAt==="number"||this.fakeFn||this.returnValueDefined},invoke:function invoke(context,args){callCallback(this,args);if(this.exception){throw this.exception}else if(this.exceptionCreator){this.exception=this.exceptionCreator();this.exceptionCreator=undefined;throw this.exception}else if(typeof this.returnArgAt==="number"){return args[this.returnArgAt]}else if(this.returnThis){return context}else if(typeof this.throwArgAt==="number"){if(args.length<this.throwArgAt){throw new TypeError("throwArgs failed: "+this.throwArgAt+" arguments required but only "+args.length+" present")}throw args[this.throwArgAt]}else if(this.fakeFn){return this.fakeFn.apply(context,args)}else if(this.resolveThis){return(this.promiseLibrary||Promise).resolve(context)}else if(this.resolve){return(this.promiseLibrary||Promise).resolve(this.returnValue)}else if(this.reject){return(this.promiseLibrary||Promise).reject(this.returnValue)}else if(this.callsThrough){return this.stub.wrappedMethod.apply(context,args)}return this.returnValue},onCall:function onCall(index){return this.stub.onCall(index)},onFirstCall:function onFirstCall(){return this.stub.onFirstCall()},onSecondCall:function onSecondCall(){return this.stub.onSecondCall()},onThirdCall:function onThirdCall(){return this.stub.onThirdCall()},withArgs:function withArgs(){throw new Error('Defining a stub by invoking "stub.onCall(...).withArgs(...)" '+'is not supported. Use "stub.withArgs(...).onCall(...)" '+"to define sequential behavior for calls with certain arguments.")}};function createAsyncVersion(syncFnName){return function(){var result=this[syncFnName].apply(this,arguments);this.callbackAsync=true;return result}}Object.keys(proto).forEach(function(method){if(method.match(/^(callsArg|yields)/)&&!method.match(/Async/)){proto[method+"Async"]=createAsyncVersion(method)}});function createBehavior(behaviorMethod){return function(){this.defaultBehavior=this.defaultBehavior||proto.create(this);this.defaultBehavior[behaviorMethod].apply(this.defaultBehavior,arguments);return this}}function addBehavior(stub,name,fn){proto[name]=function(){fn.apply(this,[this].concat([].slice.call(arguments)));return this.stub||this};stub[name]=createBehavior(name)}proto.addBehavior=addBehavior;proto.createBehavior=createBehavior;module.exports=proto}).call(this,require("_process"))},{"./util/core/extend":22,"./util/core/function-name":24,"./util/core/value-to-string":31,_process:55}],4:[function(require,module,exports){"use strict";var sinonMatch=require("./match");var deepEqual=require("./util/core/deep-equal").use(sinonMatch);var functionName=require("./util/core/function-name");var sinonFormat=require("./util/core/format");var valueToString=require("./util/core/value-to-string");var slice=Array.prototype.slice;var filter=Array.prototype.filter;function throwYieldError(proxy,text,args){var msg=functionName(proxy)+text;if(args.length){msg+=" Received ["+slice.call(args).join(", ")+"]"}throw new Error(msg)}var callProto={calledOn:function calledOn(thisValue){if(sinonMatch&&sinonMatch.isMatcher(thisValue)){return thisValue.test(this.thisValue)}return this.thisValue===thisValue},calledWith:function calledWith(){var self=this;var calledWithArgs=slice.call(arguments);if(calledWithArgs.length>self.args.length){return false}return calledWithArgs.reduce(function(prev,arg,i){return prev&&deepEqual(arg,self.args[i])},true)},calledWithMatch:function calledWithMatch(){var self=this;var calledWithMatchArgs=slice.call(arguments);if(calledWithMatchArgs.length>self.args.length){return false}return calledWithMatchArgs.reduce(function(prev,expectation,i){var actual=self.args[i];return prev&&(sinonMatch&&sinonMatch(expectation).test(actual))},true)},calledWithExactly:function calledWithExactly(){return arguments.length===this.args.length&&this.calledWith.apply(this,arguments)},notCalledWith:function notCalledWith(){return!this.calledWith.apply(this,arguments)},notCalledWithMatch:function notCalledWithMatch(){return!this.calledWithMatch.apply(this,arguments)},returned:function returned(value){return deepEqual(value,this.returnValue)},threw:function threw(error){if(typeof error==="undefined"||!this.exception){return!!this.exception}return this.exception===error||this.exception.name===error},calledWithNew:function calledWithNew(){return this.proxy.prototype&&this.thisValue instanceof this.proxy},calledBefore:function(other){return this.callId<other.callId},calledAfter:function(other){return this.callId>other.callId},calledImmediatelyBefore:function(other){return this.callId===other.callId-1},calledImmediatelyAfter:function(other){return this.callId===other.callId+1},callArg:function(pos){this.args[pos]()},callArgOn:function(pos,thisValue){this.args[pos].apply(thisValue)},callArgWith:function(pos){this.callArgOnWith.apply(this,[pos,null].concat(slice.call(arguments,1)))},callArgOnWith:function(pos,thisValue){var args=slice.call(arguments,2);this.args[pos].apply(thisValue,args)},throwArg:function(pos){if(pos>this.args.length){throw new TypeError("Not enough arguments: "+pos+" required but only "+this.args.length+" present")}throw this.args[pos]},yield:function(){this.yieldOn.apply(this,[null].concat(slice.call(arguments,0)))},yieldOn:function(thisValue){var args=slice.call(this.args);var yieldFn=filter.call(args,function(arg){return typeof arg==="function"})[0];if(!yieldFn){throwYieldError(this.proxy," cannot yield since no callback was passed.",args)}yieldFn.apply(thisValue,slice.call(arguments,1))},yieldTo:function(prop){this.yieldToOn.apply(this,[prop,null].concat(slice.call(arguments,1)))},yieldToOn:function(prop,thisValue){var args=slice.call(this.args);var yieldArg=filter.call(args,function(arg){return arg&&typeof arg[prop]==="function"})[0];var yieldFn=yieldArg&&yieldArg[prop];if(!yieldFn){throwYieldError(this.proxy," cannot yield to '"+valueToString(prop)+"' since no callback was passed.",args)}yieldFn.apply(thisValue,slice.call(arguments,2))},toString:function(){var callStr=this.proxy?this.proxy.toString()+"(":"";var formattedArgs;if(!this.args){return":("}formattedArgs=slice.call(this.args).map(function(arg){return sinonFormat(arg)});callStr=callStr+formattedArgs.join(", ")+")";if(typeof this.returnValue!=="undefined"){callStr+=" => "+sinonFormat(this.returnValue)}if(this.exception){callStr+=" !"+this.exception.name;if(this.exception.message){callStr+="("+this.exception.message+")"}}if(this.stack){callStr+=(this.stack.split("\n")[3]||"unknown").replace(/^\s*(?:at\s+|@)?/," at ")}return callStr}};Object.defineProperty(callProto,"stack",{enumerable:true,configurable:true,get:function(){return this.errorWithCallStack&&this.errorWithCallStack.stack||""}});callProto.invokeCallback=callProto.yield;function createSpyCall(spy,thisValue,args,returnValue,exception,id,errorWithCallStack){if(typeof id!=="number"){throw new TypeError("Call id is not a number")}var proxyCall=Object.create(callProto);proxyCall.proxy=spy;proxyCall.thisValue=thisValue;proxyCall.args=args;proxyCall.returnValue=returnValue;proxyCall.exception=exception;proxyCall.callId=id;proxyCall.errorWithCallStack=errorWithCallStack;return proxyCall}createSpyCall.toString=callProto.toString;module.exports=createSpyCall},{"./match":9,"./util/core/deep-equal":19,"./util/core/format":23,"./util/core/function-name":24,"./util/core/value-to-string":31}],5:[function(require,module,exports){"use strict";var walk=require("./util/core/walk");var getPropertyDescriptor=require("./util/core/get-property-descriptor");function collectMethod(methods,object,prop,propOwner){if(typeof getPropertyDescriptor(propOwner,prop).value==="function"&&object.hasOwnProperty(prop)){methods.push(object[prop])}}function collectOwnMethods(object){var methods=[];walk(object,collectMethod.bind(null,methods,object));return methods}module.exports=collectOwnMethods},{"./util/core/get-property-descriptor":26,"./util/core/walk":32}],6:[function(require,module,exports){"use strict";var sinonSpy=require("./spy");var sinonStub=require("./stub");var sinonMock=require("./mock");var collectOwnMethods=require("./collect-own-methods");var valueToString=require("./util/core/value-to-string");var push=Array.prototype.push;var filter=Array.prototype.filter;function getFakes(fakeCollection){if(!fakeCollection.fakes){fakeCollection.fakes=[]}return fakeCollection.fakes}function each(fakeCollection,method){var fakes=getFakes(fakeCollection);var matchingFakes=filter.call(fakes,function(fake){return typeof fake[method]==="function"});matchingFakes.forEach(function(fake){fake[method]()})}var collection={verify:function verify(){each(this,"verify")},restore:function restore(){each(this,"restore");this.fakes=[]},reset:function reset(){each(this,"reset")},resetBehavior:function resetBehavior(){each(this,"resetBehavior")},resetHistory:function resetHistory(){getFakes(this).forEach(function(fake){var method=fake.resetHistory||fake.reset;if(method){method.call(fake)}})},verifyAndRestore:function verifyAndRestore(){var exception;try{this.verify()}catch(e){exception=e}this.restore();if(exception){throw exception}},add:function add(fake){push.call(getFakes(this),fake);return fake},addUsingPromise:function(fake){fake.usingPromise(this.promiseLibrary);return fake},spy:function spy(){return this.add(sinonSpy.apply(sinonSpy,arguments))},createStubInstance:function createStubInstance(constructor){if(typeof constructor!=="function"){throw new TypeError("The constructor should be a function.")}return this.stub.call(this,Object.create(constructor.prototype))},stub:function stub(object,property){if(object&&typeof property!=="undefined"&&!(property in object)){throw new TypeError("Cannot stub non-existent own property "+valueToString(property))}var stubbed=sinonStub.apply(null,arguments);var isStubbingEntireObject=typeof property==="undefined"&&typeof object==="object";if(isStubbingEntireObject){var ownMethods=collectOwnMethods(stubbed);ownMethods.forEach(this.add.bind(this));if(this.promiseLibrary){ownMethods.forEach(this.addUsingPromise.bind(this))}}else{this.add(stubbed);if(this.promiseLibrary){stubbed.usingPromise(this.promiseLibrary)}}return stubbed},mock:function mock(){return this.add(sinonMock.apply(null,arguments))},inject:function inject(obj){var col=this;obj.spy=function(){return col.spy.apply(col,arguments)};obj.stub=function(){return col.stub.apply(col,arguments)};obj.mock=function(){return col.mock.apply(col,arguments)};return obj}};module.exports=collection},{"./collect-own-methods":5,"./mock":11,"./spy":14,"./stub":16,"./util/core/value-to-string":31}],7:[function(require,module,exports){"use strict";var supportsColor=require("supports-color");function colorize(str,color){if(!supportsColor){return str}return"["+color+"m"+str+""}exports.red=function(str){return colorize(str,31)};exports.green=function(str){return colorize(str,32)}},{"supports-color":57}],8:[function(require,module,exports){"use strict";var getPropertyDescriptor=require("./util/core/get-property-descriptor");var slice=[].slice;var useLeftMostCallback=-1;var useRightMostCallback=-2;function throwsException(fake,error,message){if(typeof error==="function"){fake.exceptionCreator=error}else if(typeof error==="string"){fake.exceptionCreator=function(){var newException=new Error(message||"");newException.name=error;return newException}}else if(!error){fake.exceptionCreator=function(){return new Error("Error")}}else{fake.exception=error}}function isPropertyConfigurable(obj,propName){var propertyDescriptor=getPropertyDescriptor(obj,propName);return propertyDescriptor?propertyDescriptor.configurable:true}module.exports={callsFake:function callsFake(fake,fn){fake.fakeFn=fn},callsArg:function callsArg(fake,pos){if(typeof pos!=="number"){throw new TypeError("argument index is not number")}fake.callArgAt=pos;fake.callbackArguments=[];fake.callbackContext=undefined;fake.callArgProp=undefined;fake.callbackAsync=false},callsArgOn:function callsArgOn(fake,pos,context){if(typeof pos!=="number"){throw new TypeError("argument index is not number")}fake.callArgAt=pos;fake.callbackArguments=[];fake.callbackContext=context;fake.callArgProp=undefined;fake.callbackAsync=false},callsArgWith:function callsArgWith(fake,pos){if(typeof pos!=="number"){throw new TypeError("argument index is not number")}fake.callArgAt=pos;fake.callbackArguments=slice.call(arguments,2);fake.callbackContext=undefined;fake.callArgProp=undefined;fake.callbackAsync=false},callsArgOnWith:function callsArgWith(fake,pos,context){if(typeof pos!=="number"){throw new TypeError("argument index is not number")}fake.callArgAt=pos;fake.callbackArguments=slice.call(arguments,3);fake.callbackContext=context;fake.callArgProp=undefined;fake.callbackAsync=false},usingPromise:function usingPromise(fake,promiseLibrary){fake.promiseLibrary=promiseLibrary},yields:function(fake){fake.callArgAt=useLeftMostCallback;fake.callbackArguments=slice.call(arguments,1);fake.callbackContext=undefined;fake.callArgProp=undefined;fake.callbackAsync=false},yieldsRight:function(fake){fake.callArgAt=useRightMostCallback;fake.callbackArguments=slice.call(arguments,1);fake.callbackContext=undefined;fake.callArgProp=undefined;fake.callbackAsync=false},yieldsOn:function(fake,context){fake.callArgAt=useLeftMostCallback;fake.callbackArguments=slice.call(arguments,2);fake.callbackContext=context;fake.callArgProp=undefined;fake.callbackAsync=false},yieldsTo:function(fake,prop){fake.callArgAt=useLeftMostCallback;fake.callbackArguments=slice.call(arguments,2);fake.callbackContext=undefined;fake.callArgProp=prop;fake.callbackAsync=false},yieldsToOn:function(fake,prop,context){fake.callArgAt=useLeftMostCallback;fake.callbackArguments=slice.call(arguments,3);fake.callbackContext=context;fake.callArgProp=prop;fake.callbackAsync=false},throws:throwsException,throwsException:throwsException,returns:function returns(fake,value){fake.returnValue=value;fake.resolve=false;fake.reject=false;fake.returnValueDefined=true;fake.exception=undefined;fake.exceptionCreator=undefined;fake.fakeFn=undefined},returnsArg:function returnsArg(fake,pos){if(typeof pos!=="number"){throw new TypeError("argument index is not number")}fake.returnArgAt=pos},throwsArg:function throwsArg(fake,pos){if(typeof pos!=="number"){throw new TypeError("argument index is not number")}fake.throwArgAt=pos},returnsThis:function returnsThis(fake){fake.returnThis=true},resolves:function resolves(fake,value){fake.returnValue=value;fake.resolve=true;fake.resolveThis=false;fake.reject=false;fake.returnValueDefined=true;fake.exception=undefined;fake.exceptionCreator=undefined;fake.fakeFn=undefined},rejects:function rejects(fake,error,message){var reason;if(typeof error==="string"){reason=new Error(message||"");reason.name=error}else if(!error){reason=new Error("Error")}else{reason=error}fake.returnValue=reason;fake.resolve=false;fake.resolveThis=false;fake.reject=true;fake.returnValueDefined=true;fake.exception=undefined;fake.exceptionCreator=undefined;fake.fakeFn=undefined;return fake},resolvesThis:function resolvesThis(fake){fake.returnValue=undefined;fake.resolve=false;fake.resolveThis=true;fake.reject=false;fake.returnValueDefined=false;fake.exception=undefined;fake.exceptionCreator=undefined;fake.fakeFn=undefined},callThrough:function callThrough(fake){fake.callsThrough=true},get:function get(fake,getterFunction){var rootStub=fake.stub||fake;Object.defineProperty(rootStub.rootObj,rootStub.propName,{get:getterFunction,configurable:isPropertyConfigurable(rootStub.rootObj,rootStub.propName)});return fake},set:function set(fake,setterFunction){var rootStub=fake.stub||fake;Object.defineProperty(rootStub.rootObj,rootStub.propName,{set:setterFunction,configurable:isPropertyConfigurable(rootStub.rootObj,rootStub.propName)});return fake},value:function value(fake,newVal){var rootStub=fake.stub||fake;Object.defineProperty(rootStub.rootObj,rootStub.propName,{value:newVal,enumerable:true,configurable:isPropertyConfigurable(rootStub.rootObj,rootStub.propName)});return fake}};function createAsyncVersion(syncFnName){return function(){var result=module.exports[syncFnName].apply(this,arguments);this.callbackAsync=true;return result}}Object.keys(module.exports).forEach(function(method){if(method.match(/^(callsArg|yields)/)&&!method.match(/Async/)){module.exports[method+"Async"]=createAsyncVersion(method)}})},{"./util/core/get-property-descriptor":26}],9:[function(require,module,exports){"use strict";var deepEqual=require("./util/core/deep-equal").use(match);var every=require("./util/core/every");var functionName=require("./util/core/function-name");var get=require("lodash.get");var iterableToString=require("./util/core/iterable-to-string");var typeOf=require("./util/core/typeOf");var valueToString=require("./util/core/value-to-string");var indexOf=Array.prototype.indexOf;function assertType(value,type,name){var actual=typeOf(value);if(actual!==type){throw new TypeError("Expected type of "+name+" to be "+type+", but was "+actual)}}function assertMethodExists(value,method,name,methodPath){if(value[method]==null){throw new TypeError("Expected "+name+" to have method "+methodPath)}}var matcher={toString:function(){return this.message}};function isMatcher(object){return matcher.isPrototypeOf(object)}function matchObject(expectation,actual){if(actual===null||actual===undefined){return false}return Object.keys(expectation).every(function(key){var exp=expectation[key];var act=actual[key];if(isMatcher(exp)){if(!exp.test(act)){return false}}else if(typeOf(exp)==="object"){if(!matchObject(exp,act)){return false}}else if(!deepEqual(exp,act)){return false}return true})}var TYPE_MAP={function:function(m,expectation,message){m.test=expectation;m.message=message||"match("+functionName(expectation)+")"},number:function(m,expectation){m.test=function(actual){return expectation==actual}},object:function(m,expectation){var array=[];if(typeof expectation.test==="function"){m.test=function(actual){return expectation.test(actual)===true};m.message="match("+functionName(expectation.test)+")";return m}array=Object.keys(expectation).map(function(key){return key+": "+valueToString(expectation[key])});m.test=function(actual){return matchObject(expectation,actual)};m.message="match("+array.join(", ")+")";return m},regexp:function(m,expectation){m.test=function(actual){return typeof actual==="string"&&expectation.test(actual)}},string:function(m,expectation){m.test=function(actual){return typeof actual==="string"&&actual.indexOf(expectation)!==-1};m.message='match("'+expectation+'")'}};function match(expectation,message){var m=Object.create(matcher);var type=typeOf(expectation);if(type in TYPE_MAP){TYPE_MAP[type](m,expectation,message)}else{m.test=function(actual){return deepEqual(expectation,actual)}}if(!m.message){m.message="match("+valueToString(expectation)+")"}return m}matcher.or=function(m2){if(!arguments.length){throw new TypeError("Matcher expected")}else if(!isMatcher(m2)){m2=match(m2)}var m1=this;var or=Object.create(matcher);or.test=function(actual){return m1.test(actual)||m2.test(actual)};or.message=m1.message+".or("+m2.message+")";return or};matcher.and=function(m2){if(!arguments.length){throw new TypeError("Matcher expected")}else if(!isMatcher(m2)){m2=match(m2)}var m1=this;var and=Object.create(matcher);and.test=function(actual){return m1.test(actual)&&m2.test(actual)};and.message=m1.message+".and("+m2.message+")";return and};match.isMatcher=isMatcher;match.any=match(function(){return true},"any");match.defined=match(function(actual){return actual!==null&&actual!==undefined},"defined");match.truthy=match(function(actual){return!!actual},"truthy");match.falsy=match(function(actual){return!actual},"falsy");match.same=function(expectation){return match(function(actual){return expectation===actual},"same("+valueToString(expectation)+")")};match.typeOf=function(type){assertType(type,"string","type");return match(function(actual){return typeOf(actual)===type},'typeOf("'+type+'")')};match.instanceOf=function(type){if(typeof Symbol==="undefined"||typeof Symbol.hasInstance==="undefined"){assertType(type,"function","type")}else{assertMethodExists(type,Symbol.hasInstance,"type","[Symbol.hasInstance]")}return match(function(actual){return actual instanceof type},"instanceOf("+(functionName(type)||Object.prototype.toString.call(type))+")")};function createPropertyMatcher(propertyTest,messagePrefix){return function(property,value){assertType(property,"string","property");var onlyProperty=arguments.length===1;var message=messagePrefix+'("'+property+'"';if(!onlyProperty){message+=", "+valueToString(value)}message+=")";return match(function(actual){if(actual===undefined||actual===null||!propertyTest(actual,property)){return false}return onlyProperty||deepEqual(value,actual[property])},message)}}match.has=createPropertyMatcher(function(actual,property){if(typeof actual==="object"){return property in actual}return actual[property]!==undefined},"has");match.hasOwn=createPropertyMatcher(function(actual,property){return actual.hasOwnProperty(property)},"hasOwn");match.hasNested=function(property,value){assertType(property,"string","property");var onlyProperty=arguments.length===1;var message='hasNested("'+property+'"';if(!onlyProperty){message+=", "+valueToString(value)}message+=")";return match(function(actual){if(actual===undefined||actual===null||get(actual,property)===undefined){return false}return onlyProperty||deepEqual(value,get(actual,property))},message)};match.array=match.typeOf("array");match.array.deepEquals=function(expectation){return match(function(actual){var sameLength=actual.length===expectation.length;return typeOf(actual)==="array"&&sameLength&&every(actual,function(element,index){return expectation[index]===element})},"deepEquals(["+iterableToString(expectation)+"])")};match.array.startsWith=function(expectation){return match(function(actual){return typeOf(actual)==="array"&&every(expectation,function(expectedElement,index){return actual[index]===expectedElement})},"startsWith(["+iterableToString(expectation)+"])")};match.array.endsWith=function(expectation){return match(function(actual){var offset=actual.length-expectation.length;return typeOf(actual)==="array"&&every(expectation,function(expectedElement,index){return actual[offset+index]===expectedElement})},"endsWith(["+iterableToString(expectation)+"])")};match.array.contains=function(expectation){return match(function(actual){return typeOf(actual)==="array"&&every(expectation,function(expectedElement){return indexOf.call(actual,expectedElement)!==-1})},"contains(["+iterableToString(expectation)+"])")};match.map=match.typeOf("map");match.map.deepEquals=function mapDeepEquals(expectation){return match(function(actual){var sameLength=actual.size===expectation.size;return typeOf(actual)==="map"&&sameLength&&every(actual,function(element,key){return expectation.has(key)&&expectation.get(key)===element})},"deepEquals(Map["+iterableToString(expectation)+"])")};match.map.contains=function mapContains(expectation){return match(function(actual){return typeOf(actual)==="map"&&every(expectation,function(element,key){return actual.has(key)&&actual.get(key)===element})},"contains(Map["+iterableToString(expectation)+"])")};match.set=match.typeOf("set");match.set.deepEquals=function setDeepEquals(expectation){return match(function(actual){var sameLength=actual.size===expectation.size;return typeOf(actual)==="set"&&sameLength&&every(actual,function(element){return expectation.has(element)})},"deepEquals(Set["+iterableToString(expectation)+"])")};match.set.contains=function setContains(expectation){return match(function(actual){return typeOf(actual)==="set"&&every(expectation,function(element){return actual.has(element)})},"contains(Set["+iterableToString(expectation)+"])")};match.bool=match.typeOf("boolean");match.number=match.typeOf("number");match.string=match.typeOf("string");match.object=match.typeOf("object");match.func=match.typeOf("function");match.regexp=match.typeOf("regexp");match.date=match.typeOf("date");match.symbol=match.typeOf("symbol");module.exports=match},{"./util/core/deep-equal":19,"./util/core/every":21,"./util/core/function-name":24,"./util/core/iterable-to-string":27,"./util/core/typeOf":30,"./util/core/value-to-string":31,"lodash.get":39}],10:[function(require,module,exports){"use strict";var spyInvoke=require("./spy").invoke;var spyCallToString=require("./call").toString;var timesInWords=require("./util/core/times-in-words");var extend=require("./util/core/extend");var match=require("./match");var stub=require("./stub");var assert=require("./assert");var deepEqual=require("./util/core/deep-equal").use(match);var format=require("./util/core/format");var valueToString=require("./util/core/value-to-string");var slice=Array.prototype.slice;var push=Array.prototype.push;function callCountInWords(callCount){if(callCount===0){return"never called"}return"called "+timesInWords(callCount)}function expectedCallCountInWords(expectation){var min=expectation.minCalls;var max=expectation.maxCalls;if(typeof min==="number"&&typeof max==="number"){var str=timesInWords(min);if(min!==max){str="at least "+str+" and at most "+timesInWords(max)}return str}if(typeof min==="number"){return"at least "+timesInWords(min)}return"at most "+timesInWords(max)}function receivedMinCalls(expectation){var hasMinLimit=typeof expectation.minCalls==="number";return!hasMinLimit||expectation.callCount>=expectation.minCalls}function receivedMaxCalls(expectation){if(typeof expectation.maxCalls!=="number"){return false}return expectation.callCount===expectation.maxCalls}function verifyMatcher(possibleMatcher,arg){var isMatcher=match&&match.isMatcher(possibleMatcher);return isMatcher&&possibleMatcher.test(arg)||true}var mockExpectation={minCalls:1,maxCalls:1,create:function create(methodName){var expectation=extend(stub.create(),mockExpectation);delete expectation.create;expectation.method=methodName;return expectation},invoke:function invoke(func,thisValue,args){this.verifyCallAllowed(thisValue,args);return spyInvoke.apply(this,arguments)},atLeast:function atLeast(num){if(typeof num!=="number"){throw new TypeError("'"+valueToString(num)+"' is not number")}if(!this.limitsSet){this.maxCalls=null;this.limitsSet=true}this.minCalls=num;return this},atMost:function atMost(num){if(typeof num!=="number"){throw new TypeError("'"+valueToString(num)+"' is not number")}if(!this.limitsSet){this.minCalls=null;this.limitsSet=true}this.maxCalls=num;return this},never:function never(){return this.exactly(0)},once:function once(){return this.exactly(1)},twice:function twice(){return this.exactly(2)},thrice:function thrice(){return this.exactly(3)},exactly:function exactly(num){if(typeof num!=="number"){throw new TypeError("'"+valueToString(num)+"' is not a number")}this.atLeast(num);return this.atMost(num)},met:function met(){return!this.failed&&receivedMinCalls(this)},verifyCallAllowed:function verifyCallAllowed(thisValue,args){var expectedArguments=this.expectedArguments;if(receivedMaxCalls(this)){this.failed=true;mockExpectation.fail(this.method+" already called "+timesInWords(this.maxCalls))}if("expectedThis"in this&&this.expectedThis!==thisValue){mockExpectation.fail(this.method+" called with "+valueToString(thisValue)+" as thisValue, expected "+valueToString(this.expectedThis))}if(!("expectedArguments"in this)){return}if(!args){mockExpectation.fail(this.method+" received no arguments, expected "+format(expectedArguments))}if(args.length<expectedArguments.length){mockExpectation.fail(this.method+" received too few arguments ("+format(args)+"), expected "+format(expectedArguments))}if(this.expectsExactArgCount&&args.length!==expectedArguments.length){mockExpectation.fail(this.method+" received too many arguments ("+format(args)+"), expected "+format(expectedArguments))}expectedArguments.forEach(function(expectedArgument,i){if(!verifyMatcher(expectedArgument,args[i])){mockExpectation.fail(this.method+" received wrong arguments "+format(args)+", didn't match "+expectedArguments.toString())}if(!deepEqual(expectedArgument,args[i])){mockExpectation.fail(this.method+" received wrong arguments "+format(args)+", expected "+format(expectedArguments))}},this)},allowsCall:function allowsCall(thisValue,args){var expectedArguments=this.expectedArguments;if(this.met()&&receivedMaxCalls(this)){return false}if("expectedThis"in this&&this.expectedThis!==thisValue){return false}if(!("expectedArguments"in this)){return true}args=args||[];if(args.length<expectedArguments.length){return false}if(this.expectsExactArgCount&&args.length!==expectedArguments.length){return false}return expectedArguments.every(function(expectedArgument,i){if(!verifyMatcher(expectedArgument,args[i])){return false}if(!deepEqual(expectedArgument,args[i])){return false}return true})},withArgs:function withArgs(){this.expectedArguments=slice.call(arguments);return this},withExactArgs:function withExactArgs(){this.withArgs.apply(this,arguments);this.expectsExactArgCount=true;return this},on:function on(thisValue){this.expectedThis=thisValue;return this},toString:function(){var args=(this.expectedArguments||[]).slice();if(!this.expectsExactArgCount){push.call(args,"[...]")}var callStr=spyCallToString.call({proxy:this.method||"anonymous mock expectation",args:args});var message=callStr.replace(", [...","[, ...")+" "+expectedCallCountInWords(this);if(this.met()){return"Expectation met: "+message}return"Expected "+message+" ("+callCountInWords(this.callCount)+")"},verify:function verify(){if(!this.met()){mockExpectation.fail(this.toString())}else{mockExpectation.pass(this.toString())}return true},pass:function pass(message){assert.pass(message)},fail:function fail(message){var exception=new Error(message);exception.name="ExpectationError";throw exception}};module.exports=mockExpectation},{"./assert":2,"./call":4,"./match":9,"./spy":14,"./stub":16,"./util/core/deep-equal":19,"./util/core/extend":22,"./util/core/format":23,"./util/core/times-in-words":29,"./util/core/value-to-string":31}],11:[function(require,module,exports){"use strict";var mockExpectation=require("./mock-expectation");var spyCallToString=require("./call").toString;var extend=require("./util/core/extend");var match=require("./match");var deepEqual=require("./util/core/deep-equal").use(match);var wrapMethod=require("./util/core/wrap-method");var push=Array.prototype.push;var filter=Array.prototype.filter;function mock(object){if(!object||typeof object==="string"){return mockExpectation.create(object?object:"Anonymous mock")}return mock.create(object)}function each(collection,callback){var col=collection||[];col.forEach(callback)}function arrayEquals(arr1,arr2,compareLength){if(compareLength&&arr1.length!==arr2.length){return false}return arr1.every(function(element,i){return deepEqual(element,arr2[i])})}extend(mock,{create:function create(object){if(!object){throw new TypeError("object is null")}var mockObject=extend({},mock);mockObject.object=object;delete mockObject.create;return mockObject},expects:function expects(method){if(!method){throw new TypeError("method is falsy")}if(!this.expectations){this.expectations={};this.proxies=[];this.failures=[]}if(!this.expectations[method]){this.expectations[method]=[];var mockObject=this;wrapMethod(this.object,method,function(){return mockObject.invokeMethod(method,this,arguments)});push.call(this.proxies,method)}var expectation=mockExpectation.create(method);extend(expectation,this.object[method]);push.call(this.expectations[method],expectation);return expectation},restore:function restore(){var object=this.object;each(this.proxies,function(proxy){if(typeof object[proxy].restore==="function"){object[proxy].restore()}})},verify:function verify(){var expectations=this.expectations||{};var messages=this.failures?this.failures.slice():[];var met=[];each(this.proxies,function(proxy){each(expectations[proxy],function(expectation){if(!expectation.met()){push.call(messages,expectation.toString())}else{push.call(met,expectation.toString())}})});this.restore();if(messages.length>0){mockExpectation.fail(messages.concat(met).join("\n"))}else if(met.length>0){mockExpectation.pass(messages.concat(met).join("\n"))}return true},invokeMethod:function invokeMethod(method,thisValue,args){var expectations=this.expectations&&this.expectations[method]?this.expectations[method]:[];var currentArgs=args||[];var available;var expectationsWithMatchingArgs=filter.call(expectations,function(expectation){var expectedArgs=expectation.expectedArguments||[];return arrayEquals(expectedArgs,currentArgs,expectation.expectsExactArgCount)});var expectationsToApply=filter.call(expectationsWithMatchingArgs,function(expectation){return!expectation.met()&&expectation.allowsCall(thisValue,args)});if(expectationsToApply.length>0){return expectationsToApply[0].apply(thisValue,args)}var messages=[];var exhausted=0;expectationsWithMatchingArgs.forEach(function(expectation){if(expectation.allowsCall(thisValue,args)){available=available||expectation}else{exhausted+=1}});if(available&&exhausted===0){return available.apply(thisValue,args)}expectations.forEach(function(expectation){push.call(messages," "+expectation.toString())});messages.unshift("Unexpected call: "+spyCallToString.call({proxy:method,args:args}));var err=new Error;if(!err.stack){try{throw err}catch(e){}}this.failures.push("Unexpected call: "+spyCallToString.call({proxy:method,args:args,stack:err.stack}));mockExpectation.fail(messages.join("\n"))}});module.exports=mock},{"./call":4,"./match":9,"./mock-expectation":10,"./util/core/deep-equal":19,"./util/core/extend":22,"./util/core/wrap-method":33}],12:[function(require,module,exports){"use strict";var extend=require("./util/core/extend");var sinonCollection=require("./collection");var sinonMatch=require("./match");var sinonAssert=require("./assert");var sinonClock=require("./util/fake_timers");var fakeServer=require("nise").fakeServer;var fakeXhr=require("nise").fakeXhr;var fakeServerWithClock=require("nise").fakeServerWithClock;var push=[].push;var sinonSandbox=Object.create(sinonCollection);function exposeValue(sandbox,config,key,value){if(!value){return}if(config.injectInto&&!(key in config.injectInto)){config.injectInto[key]=value;sandbox.injectedKeys.push(key)}else{push.call(sandbox.args,value)}}function prepareSandboxFromConfig(config){var sandbox=Object.create(sinonSandbox);if(config.useFakeServer){if(typeof config.useFakeServer==="object"){sandbox.serverPrototype=config.useFakeServer}sandbox.useFakeServer()}if(config.useFakeTimers){if(typeof config.useFakeTimers==="object"){sandbox.useFakeTimers.call(sandbox,config.useFakeTimers)}else{sandbox.useFakeTimers()}}return sandbox}extend(sinonSandbox,{useFakeTimers:function(args){this.clock=sinonClock.useFakeTimers.call(null,args);return this.add(this.clock)},serverPrototype:fakeServerWithClock,useFakeServer:function useFakeServer(){var proto=this.serverPrototype||fakeServer;if(!proto||!proto.create){return null}this.server=proto.create();return this.add(this.server)},useFakeXMLHttpRequest:function useFakeXMLHttpRequest(){var xhr=fakeXhr.useFakeXMLHttpRequest();return this.add(xhr)},inject:function(obj){sinonCollection.inject.call(this,obj);if(this.clock){obj.clock=this.clock}if(this.server){obj.server=this.server;obj.requests=this.server.requests}obj.match=sinonMatch;return obj},usingPromise:function(promiseLibrary){this.promiseLibrary=promiseLibrary;return this},restore:function(){if(arguments.length){throw new Error("sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()")}sinonCollection.restore.apply(this,arguments);this.restoreContext()},restoreContext:function(){var injectedKeys=this.injectedKeys;var injectInto=this.injectInto;if(!injectedKeys){return}injectedKeys.forEach(function(injectedKey){delete injectInto[injectedKey]});injectedKeys=[]},create:function(config){if(!config){return Object.create(sinonSandbox)}var sandbox=prepareSandboxFromConfig(config);sandbox.args=sandbox.args||[];sandbox.injectedKeys=[];sandbox.injectInto=config.injectInto;var exposed=sandbox.inject({});if(config.properties){config.properties.forEach(function(prop){var value=exposed[prop]||prop==="sandbox"&&sandbox;exposeValue(sandbox,config,prop,value)})}else{exposeValue(sandbox,config,"sandbox")}return sandbox},match:sinonMatch,assert:sinonAssert});module.exports=sinonSandbox},{"./assert":2,"./collection":6,"./match":9,"./util/core/extend":22,"./util/fake_timers":34,nise:52}],13:[function(require,module,exports){"use strict";var color=require("./color");var timesInWords=require("./util/core/times-in-words");var sinonFormat=require("./util/core/format");var sinonMatch=require("./match");var jsDiff=require("diff");var push=Array.prototype.push;function colorSinonMatchText(matcher,calledArg,calledArgMessage){if(!matcher.test(calledArg)){matcher.message=color.red(matcher.message);if(calledArgMessage){calledArgMessage=color.green(calledArgMessage)}}return calledArgMessage+" "+matcher.message}function colorDiffText(diff){var objects=diff.map(function(part){var text=part.value;if(part.added){text=color.green(text)}else if(part.removed){text=color.red(text)}if(diff.length===2){text+=" "}return text});return objects.join("")}module.exports={c:function(spyInstance){return timesInWords(spyInstance.callCount)},n:function(spyInstance){return spyInstance.toString()},D:function(spyInstance,args){var message="";for(var i=0,l=spyInstance.callCount;i<l;++i){if(l>1){if(i>0){message+="\n"}message+="Call "+(i+1)+":"}var calledArgs=spyInstance.getCall(i).args;for(var j=0;j<calledArgs.length||j<args.length;++j){message+="\n";var calledArgMessage=j<calledArgs.length?sinonFormat(calledArgs[j]):"";if(sinonMatch.isMatcher(args[j])){message+=colorSinonMatchText(args[j],calledArgs[j],calledArgMessage)}else{var expectedArgMessage=j<args.length?sinonFormat(args[j]):"";var diff=jsDiff.diffJson(calledArgMessage,expectedArgMessage);message+=colorDiffText(diff)}}}return message},C:function(spyInstance){var calls=[];for(var i=0,l=spyInstance.callCount;i<l;++i){var stringifiedCall=" "+spyInstance.getCall(i).toString();if(/\n/.test(calls[i-1])){stringifiedCall="\n"+stringifiedCall}push.call(calls,stringifiedCall)}return calls.length>0?"\n"+calls.join("\n"):""},t:function(spyInstance){var objects=[];for(var i=0,l=spyInstance.callCount;i<l;++i){push.call(objects,sinonFormat(spyInstance.thisValues[i]))}return objects.join(", ")},"*":function(spyInstance,args){return args.map(function(arg){return sinonFormat(arg)}).join(", ")}}},{"./color":7,"./match":9,"./util/core/format":23,"./util/core/times-in-words":29,diff:35}],14:[function(require,module,exports){"use strict";var createBehavior=require("./behavior").create;var extend=require("./util/core/extend");var functionName=require("./util/core/function-name");var functionToString=require("./util/core/function-to-string");var getPropertyDescriptor=require("./util/core/get-property-descriptor");var sinonMatch=require("./match");var deepEqual=require("./util/core/deep-equal").use(sinonMatch);var spyCall=require("./call");var wrapMethod=require("./util/core/wrap-method");var sinonFormat=require("./util/core/format");var valueToString=require("./util/core/value-to-string");var push=Array.prototype.push;var slice=Array.prototype.slice;var filter=Array.prototype.filter;var ErrorConstructor=Error.prototype.constructor;var callId=0;function spy(object,property,types){var descriptor,methodDesc;if(!property&&typeof object==="function"){return spy.create(object)}if(!object&&!property