!function(n,t){function r(n,t){return t.forEach(function(t){-1===n.indexOf(t)&&n.push(t)}),n}function e(n){return r(Object.getOwnPropertyNames(t.prototype),["catch","finally"]).filter(function(n){return"then"!==n}).reduce(function(n,t){return n[t]=function(){var n=arguments,r=this.then();return r[t].apply(r,n)},n},{then:function(t,r){return n().then(t,r)}})}function u(n){return this.returns(e(function(){return new t(function(t){t(n)})}))}function o(n){return"string"==typeof n&&(n=new Error(n)),this.returns(e(function(){return new t(function(t,r){r(n)})}))}n.stub.resolves=u,n.behavior.resolves=u,n.stub.rejects=o,n.behavior.rejects=o}(window.sinon,window.Promise);