Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2781 from pranavparikh/master

Adding chai library
  • Loading branch information...
commit e34970adf52f6c00e49d96a02d4b13b8da6ae88c 2 parents 9521070 + 49c6191
Pete Cooper authored
View
4,696 ajax/libs/chai/1.9.0/chai.js
4,696 additions, 0 deletions not shown
View
2  ajax/libs/chai/1.9.0/chai.min.js
@@ -0,0 +1,2 @@
+!function(){function require(a,b,c){var d=require.resolve(a);if(null==d){c=c||a,b=b||"root";var e=new Error('Failed to require "'+c+'" from "'+b+'"');throw e.path=c,e.parent=b,e.require=!0,e}var f=require.modules[d];if(!f._resolving&&!f.exports){var g={};g.exports={},g.client=g.component=!0,f._resolving=!0,f.call(this,g.exports,require.relative(d),g),delete f._resolving,f.exports=g.exports}return f.exports}require.modules={},require.aliases={},require.resolve=function(a){"/"===a.charAt(0)&&(a=a.slice(1));for(var b=[a,a+".js",a+".json",a+"/index.js",a+"/index.json"],c=0;c<b.length;c++){var a=b[c];if(require.modules.hasOwnProperty(a))return a;if(require.aliases.hasOwnProperty(a))return require.aliases[a]}},require.normalize=function(a,b){var c=[];if("."!=b.charAt(0))return b;a=a.split("/"),b=b.split("/");for(var d=0;d<b.length;++d)".."==b[d]?a.pop():"."!=b[d]&&""!=b[d]&&c.push(b[d]);return a.concat(c).join("/")},require.register=function(a,b){require.modules[a]=b},require.alias=function(a,b){if(!require.modules.hasOwnProperty(a))throw new Error('Failed to alias "'+a+'", it does not exist');require.aliases[b]=a},require.relative=function(a){function c(a,b){for(var c=a.length;c--;)if(a[c]===b)return c;return-1}function d(b){var c=d.resolve(b);return require(c,a,b)}var b=require.normalize(a,"..");return d.resolve=function(d){var e=d.charAt(0);if("/"==e)return d.slice(1);if("."==e)return require.normalize(b,d);var f=a.split("/"),g=c(f,"deps")+1;return g||(g=0),d=f.slice(0,g+1).join("/")+"/deps/"+d},d.exists=function(a){return require.modules.hasOwnProperty(d.resolve(a))},d},require.register("chaijs-assertion-error/index.js",function(a,b,c){function d(){function b(b,c){Object.keys(c).forEach(function(d){~a.indexOf(d)||(b[d]=c[d])})}var a=[].slice.call(arguments);return function(){for(var a=[].slice.call(arguments),c=0,d={};c<a.length;c++)b(d,a[c]);return d}}function e(a,b,c){var e=d("name","message","stack","constructor","toJSON"),f=e(b||{});this.message=a||"Unspecified AssertionError",this.showDiff=!1;for(var g in f)this[g]=f[g];c=c||arguments.callee,c&&Error.captureStackTrace&&Error.captureStackTrace(this,c)}c.exports=e,e.prototype=Object.create(Error.prototype),e.prototype.name="AssertionError",e.prototype.constructor=e,e.prototype.toJSON=function(a){var b=d("constructor","toJSON","stack"),c=b({name:this.name},this);return!1!==a&&this.stack&&(c.stack=this.stack),c}}),require.register("chaijs-type-detect/lib/type.js",function(a,b,c){function e(a){var b=Object.prototype.toString.call(a);return d[b]?d[b]:null===a?"null":void 0===a?"undefined":a===Object(a)?"object":typeof a}function f(){this.tests={}}var a=c.exports=e,d={"[object Array]":"array","[object RegExp]":"regexp","[object Function]":"function","[object Arguments]":"arguments","[object Date]":"date"};a.Library=f,f.prototype.of=e,f.prototype.define=function(a,b){return 1===arguments.length?this.tests[a]:(this.tests[a]=b,this)},f.prototype.test=function(a,b){if(b===e(a))return!0;var c=this.tests[b];if(c&&"regexp"===e(c))return c.test(a);if(c&&"function"===e(c))return c(a);throw new ReferenceError('Type test "'+b+'" not defined or invalid.')}}),require.register("chaijs-deep-eql/lib/eql.js",function(a,b,c){function g(a,b,c){return h(a,b)?!0:"date"===d(a)?j(a,b):"regexp"===d(a)?k(a,b):e.isBuffer(a)?o(a,b):"arguments"===d(a)?l(a,b,c):i(a,b)?"object"!==d(a)&&"object"!==d(b)&&"array"!==d(a)&&"array"!==d(b)?h(a,b):q(a,b,c):!1}function h(a,b){return a===b?0!==a||1/a===1/b:a!==a&&b!==b}function i(a,b){return d(a)===d(b)}function j(a,b){return"date"!==d(b)?!1:h(a.getTime(),b.getTime())}function k(a,b){return"regexp"!==d(b)?!1:h(a.toString(),b.toString())}function l(a,b,c){return"arguments"!==d(b)?!1:(a=[].slice.call(a),b=[].slice.call(b),g(a,b,c))}function m(a){var b=[];for(var c in a)b.push(c);return b}function n(a,b){if(a.length!==b.length)return!1;for(var c=0,d=!0;c<a.length;c++)if(a[c]!==b[c]){d=!1;break}return d}function o(a,b){return e.isBuffer(b)?n(a,b):!1}function p(a){return null!==a&&void 0!==a}function q(a,b,c){if(!p(a)||!p(b))return!1;if(a.prototype!==b.prototype)return!1;var d;if(c){for(d=0;d<c.length;d++)if(c[d][0]===a&&c[d][1]===b||c[d][0]===b&&c[d][1]===a)return!0}else c=[];try{var e=m(a),f=m(b)}catch(h){return!1}if(e.sort(),f.sort(),!n(e,f))return!1;c.push([a,b]);var i;for(d=e.length-1;d>=0;d--)if(i=e[d],!g(a[i],b[i],c))return!1;return!0}var e,d=b("type-detect");try{e=b("buffer").Buffer}catch(f){e={},e.isBuffer=function(){return!1}}c.exports=g}),require.register("chai/index.js",function(a,b,c){c.exports=b("./lib/chai")}),require.register("chai/lib/chai.js",function(a,b,c){var d=[],a=c.exports={};a.version="1.8.1",a.AssertionError=b("assertion-error");var e=b("./chai/utils");a.use=function(a){return~d.indexOf(a)||(a(this,e),d.push(a)),this};var f=b("./chai/assertion");a.use(f);var g=b("./chai/core/assertions");a.use(g);var h=b("./chai/interface/expect");a.use(h);var i=b("./chai/interface/should");a.use(i);var j=b("./chai/interface/assert");a.use(j)}),require.register("chai/lib/chai/assertion.js",function(a,b,c){c.exports=function(a,b){function e(a,b,c){d(this,"ssfi",c||arguments.callee),d(this,"object",a),d(this,"message",b)}var c=a.AssertionError,d=b.flag;a.Assertion=e,e.includeStack=!1,e.showDiff=!0,e.addProperty=function(a,c){b.addProperty(this.prototype,a,c)},e.addMethod=function(a,c){b.addMethod(this.prototype,a,c)},e.addChainableMethod=function(a,c,d){b.addChainableMethod(this.prototype,a,c,d)},e.overwriteProperty=function(a,c){b.overwriteProperty(this.prototype,a,c)},e.overwriteMethod=function(a,c){b.overwriteMethod(this.prototype,a,c)},e.overwriteChainableMethod=function(a,c,d){b.overwriteChainableMethod(this.prototype,a,c,d)},e.prototype.assert=function(a,f,g,h,i,j){var k=b.test(this,arguments);if(!0!==j&&(j=!1),!0!==e.showDiff&&(j=!1),!k){var f=b.getMessage(this,arguments),l=b.getActual(this,arguments);throw new c(f,{actual:l,expected:h,showDiff:j},e.includeStack?this.assert:d(this,"ssfi"))}},Object.defineProperty(e.prototype,"_obj",{get:function(){return d(this,"object")},set:function(a){d(this,"object",a)}})}}),require.register("chai/lib/chai/core/assertions.js",function(a,b,c){c.exports=function(a,b){function f(a,c){c&&e(this,"message",c),a=a.toLowerCase();var d=e(this,"object"),f=~["a","e","i","o","u"].indexOf(a.charAt(0))?"an ":"a ";this.assert(a===b.type(d),"expected #{this} to be "+f+a,"expected #{this} not to be "+f+a)}function g(){e(this,"contains",!0)}function h(a,d){d&&e(this,"message",d);var f=e(this,"object");if("object"===b.type(a)){if(!e(this,"negate")){for(var g in a)new c(f).property(g,a[g]);return}var h={};for(var g in a)h[g]=f[g];var i=b.eql(h,a)}else var i=f&&~f.indexOf(a);this.assert(i,"expected #{this} to include "+b.inspect(a),"expected #{this} to not include "+b.inspect(a))}function i(){var a=e(this,"object"),b=Object.prototype.toString.call(a);this.assert("[object Arguments]"===b,"expected #{this} to be arguments but got "+b,"expected #{this} to not be arguments")}function j(a,b){b&&e(this,"message",b);var c=e(this,"object");return e(this,"deep")?this.eql(a):(this.assert(a===c,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",a,this._obj,!0),void 0)}function k(a,c){c&&e(this,"message",c),this.assert(b.eql(a,e(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",a,this._obj,!0)}function l(a,b){b&&e(this,"message",b);var d=e(this,"object");if(e(this,"doLength")){new c(d,b).to.have.property("length");var f=d.length;this.assert(f>a,"expected #{this} to have a length above #{exp} but got #{act}","expected #{this} to not have a length above #{exp}",a,f)}else this.assert(d>a,"expected #{this} to be above "+a,"expected #{this} to be at most "+a)}function m(a,b){b&&e(this,"message",b);var d=e(this,"object");if(e(this,"doLength")){new c(d,b).to.have.property("length");var f=d.length;this.assert(f>=a,"expected #{this} to have a length at least #{exp} but got #{act}","expected #{this} to have a length below #{exp}",a,f)}else this.assert(d>=a,"expected #{this} to be at least "+a,"expected #{this} to be below "+a)}function n(a,b){b&&e(this,"message",b);var d=e(this,"object");if(e(this,"doLength")){new c(d,b).to.have.property("length");var f=d.length;this.assert(a>f,"expected #{this} to have a length below #{exp} but got #{act}","expected #{this} to not have a length below #{exp}",a,f)}else this.assert(a>d,"expected #{this} to be below "+a,"expected #{this} to be at least "+a)}function o(a,b){b&&e(this,"message",b);var d=e(this,"object");if(e(this,"doLength")){new c(d,b).to.have.property("length");var f=d.length;this.assert(a>=f,"expected #{this} to have a length at most #{exp} but got #{act}","expected #{this} to have a length above #{exp}",a,f)}else this.assert(a>=d,"expected #{this} to be at most "+a,"expected #{this} to be above "+a)}function p(a,c){c&&e(this,"message",c);var d=b.getName(a);this.assert(e(this,"object")instanceof a,"expected #{this} to be an instance of "+d,"expected #{this} to not be an instance of "+d)}function q(a,c){c&&e(this,"message",c);var d=e(this,"object");this.assert(d.hasOwnProperty(a),"expected #{this} to have own property "+b.inspect(a),"expected #{this} to not have own property "+b.inspect(a))}function r(){e(this,"doLength",!0)}function s(a,b){b&&e(this,"message",b);var d=e(this,"object");new c(d,b).to.have.property("length");var f=d.length;this.assert(f==a,"expected #{this} to have a length of #{exp} but got #{act}","expected #{this} to not have a length of #{act}",a,f)}function t(a){var d,c=e(this,"object"),f=!0;if(a=a instanceof Array?a:Array.prototype.slice.call(arguments),!a.length)throw new Error("keys required");var g=Object.keys(c),h=a.length;if(f=a.every(function(a){return~g.indexOf(a)}),e(this,"negate")||e(this,"contains")||(f=f&&a.length==g.length),h>1){a=a.map(function(a){return b.inspect(a)});var i=a.pop();d=a.join(", ")+", and "+i}else d=b.inspect(a[0]);d=(h>1?"keys ":"key ")+d,d=(e(this,"contains")?"contain ":"have ")+d,this.assert(f,"expected #{this} to "+d,"expected #{this} to not "+d)}function u(a,d,f){f&&e(this,"message",f);var g=e(this,"object");new c(g,f).is.a("function");var h=!1,i=null,j=null,k=null;0===arguments.length?(d=null,a=null):a&&(a instanceof RegExp||"string"==typeof a)?(d=a,a=null):a&&a instanceof Error?(i=a,a=null,d=null):"function"==typeof a?(j=a.prototype.name||a.name,"Error"===j&&a!==Error&&(j=(new a).name)):a=null;try{g()}catch(l){if(i)return this.assert(l===i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}",i instanceof Error?i.toString():i,l instanceof Error?l.toString():l),e(this,"object",l),this;if(a&&(this.assert(l instanceof a,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp} but #{act} was thrown",j,l instanceof Error?l.toString():l),!d))return e(this,"object",l),this;var m="object"===b.type(l)&&"message"in l?l.message:""+l;if(null!=m&&d&&d instanceof RegExp)return this.assert(d.exec(m),"expected #{this} to throw error matching #{exp} but got #{act}","expected #{this} to throw error not matching #{exp}",d,m),e(this,"object",l),this;if(null!=m&&d&&"string"==typeof d)return this.assert(~m.indexOf(d),"expected #{this} to throw error including #{exp} but got #{act}","expected #{this} to throw error not including #{act}",d,m),e(this,"object",l),this;h=!0,k=l}var n="",o=null!==j?j:i?"#{exp}":"an error";h&&(n=" but #{act} was thrown"),this.assert(h===!0,"expected #{this} to throw "+o+n,"expected #{this} to not throw "+o+n,i instanceof Error?i.toString():i,k instanceof Error?k.toString():k),e(this,"object",k)}function v(a,b){return a.every(function(a){return-1!==b.indexOf(a)})}var c=a.Assertion,e=(Object.prototype.toString,b.flag);["to","be","been","is","and","has","have","with","that","at","of","same"].forEach(function(a){c.addProperty(a,function(){return this})}),c.addProperty("not",function(){e(this,"negate",!0)}),c.addProperty("deep",function(){e(this,"deep",!0)}),c.addChainableMethod("an",f),c.addChainableMethod("a",f),c.addChainableMethod("include",h,g),c.addChainableMethod("contain",h,g),c.addProperty("ok",function(){this.assert(e(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),c.addProperty("true",function(){this.assert(!0===e(this,"object"),"expected #{this} to be true","expected #{this} to be false",this.negate?!1:!0)}),c.addProperty("false",function(){this.assert(!1===e(this,"object"),"expected #{this} to be false","expected #{this} to be true",this.negate?!0:!1)}),c.addProperty("null",function(){this.assert(null===e(this,"object"),"expected #{this} to be null","expected #{this} not to be null")}),c.addProperty("undefined",function(){this.assert(void 0===e(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")}),c.addProperty("exist",function(){this.assert(null!=e(this,"object"),"expected #{this} to exist","expected #{this} to not exist")}),c.addProperty("empty",function(){var a=e(this,"object"),b=a;Array.isArray(a)||"string"==typeof object?b=a.length:"object"==typeof a&&(b=Object.keys(a).length),this.assert(!b,"expected #{this} to be empty","expected #{this} not to be empty")}),c.addProperty("arguments",i),c.addProperty("Arguments",i),c.addMethod("equal",j),c.addMethod("equals",j),c.addMethod("eq",j),c.addMethod("eql",k),c.addMethod("eqls",k),c.addMethod("above",l),c.addMethod("gt",l),c.addMethod("greaterThan",l),c.addMethod("least",m),c.addMethod("gte",m),c.addMethod("below",n),c.addMethod("lt",n),c.addMethod("lessThan",n),c.addMethod("most",o),c.addMethod("lte",o),c.addMethod("within",function(a,b,d){d&&e(this,"message",d);var f=e(this,"object"),g=a+".."+b;if(e(this,"doLength")){new c(f,d).to.have.property("length");var h=f.length;this.assert(h>=a&&b>=h,"expected #{this} to have a length within "+g,"expected #{this} to not have a length within "+g)}else this.assert(f>=a&&b>=f,"expected #{this} to be within "+g,"expected #{this} to not be within "+g)}),c.addMethod("instanceof",p),c.addMethod("instanceOf",p),c.addMethod("property",function(a,c,d){d&&e(this,"message",d);var f=e(this,"deep")?"deep property ":"property ",g=e(this,"negate"),h=e(this,"object"),i=e(this,"deep")?b.getPathValue(a,h):h[a];if(g&&void 0!==c){if(void 0===i)throw d=null!=d?d+": ":"",new Error(d+b.inspect(h)+" has no "+f+b.inspect(a))}else this.assert(void 0!==i,"expected #{this} to have a "+f+b.inspect(a),"expected #{this} to not have "+f+b.inspect(a));void 0!==c&&this.assert(c===i,"expected #{this} to have a "+f+b.inspect(a)+" of #{exp}, but got #{act}","expected #{this} to not have a "+f+b.inspect(a)+" of #{act}",c,i),e(this,"object",i)}),c.addMethod("ownProperty",q),c.addMethod("haveOwnProperty",q),c.addChainableMethod("length",s,r),c.addMethod("lengthOf",s,r),c.addMethod("match",function(a,b){b&&e(this,"message",b);var c=e(this,"object");this.assert(a.exec(c),"expected #{this} to match "+a,"expected #{this} not to match "+a)}),c.addMethod("string",function(a,d){d&&e(this,"message",d);var f=e(this,"object");new c(f,d).is.a("string"),this.assert(~f.indexOf(a),"expected #{this} to contain "+b.inspect(a),"expected #{this} to not contain "+b.inspect(a))}),c.addMethod("keys",t),c.addMethod("key",t),c.addMethod("throw",u),c.addMethod("throws",u),c.addMethod("Throw",u),c.addMethod("respondTo",function(a,c){c&&e(this,"message",c);var d=e(this,"object"),f=e(this,"itself"),g="function"!==b.type(d)||f?d[a]:d.prototype[a];this.assert("function"==typeof g,"expected #{this} to respond to "+b.inspect(a),"expected #{this} to not respond to "+b.inspect(a))}),c.addProperty("itself",function(){e(this,"itself",!0)}),c.addMethod("satisfy",function(a,c){c&&e(this,"message",c);var d=e(this,"object");this.assert(a(d),"expected #{this} to satisfy "+b.objDisplay(a),"expected #{this} to not satisfy"+b.objDisplay(a),this.negate?!1:!0,a(d))}),c.addMethod("closeTo",function(a,b,c){c&&e(this,"message",c);var d=e(this,"object");this.assert(Math.abs(d-a)<=b,"expected #{this} to be close to "+a+" +/- "+b,"expected #{this} not to be close to "+a+" +/- "+b)}),c.addMethod("members",function(a,b){b&&e(this,"message",b);var d=e(this,"object");return new c(d).to.be.an("array"),new c(a).to.be.an("array"),e(this,"contains")?this.assert(v(a,d),"expected #{this} to be a superset of #{act}","expected #{this} to not be a superset of #{act}",d,a):(this.assert(v(d,a)&&v(a,d),"expected #{this} to have the same members as #{act}","expected #{this} to not have the same members as #{act}",d,a),void 0)})}}),require.register("chai/lib/chai/interface/assert.js",function(exports,require,module){module.exports=function(chai,util){var Assertion=chai.Assertion,flag=util.flag,assert=chai.assert=function(a,b){var c=new Assertion(null);c.assert(a,b,"[ negation message unavailable ]")};assert.fail=function(a,b,c,d){throw c=c||"assert.fail()",new chai.AssertionError(c,{actual:a,expected:b,operator:d},assert.fail)},assert.ok=function(a,b){new Assertion(a,b).is.ok},assert.notOk=function(a,b){new Assertion(a,b).is.not.ok},assert.equal=function(a,b,c){var d=new Assertion(a,c);d.assert(b==flag(d,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",b,a)},assert.notEqual=function(a,b,c){var d=new Assertion(a,c);d.assert(b!=flag(d,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",b,a)},assert.strictEqual=function(a,b,c){new Assertion(a,c).to.equal(b)},assert.notStrictEqual=function(a,b,c){new Assertion(a,c).to.not.equal(b)},assert.deepEqual=function(a,b,c){new Assertion(a,c).to.eql(b)},assert.notDeepEqual=function(a,b,c){new Assertion(a,c).to.not.eql(b)},assert.isTrue=function(a,b){new Assertion(a,b).is["true"]},assert.isFalse=function(a,b){new Assertion(a,b).is["false"]},assert.isNull=function(a,b){new Assertion(a,b).to.equal(null)},assert.isNotNull=function(a,b){new Assertion(a,b).to.not.equal(null)},assert.isUndefined=function(a,b){new Assertion(a,b).to.equal(void 0)},assert.isDefined=function(a,b){new Assertion(a,b).to.not.equal(void 0)},assert.isFunction=function(a,b){new Assertion(a,b).to.be.a("function")},assert.isNotFunction=function(a,b){new Assertion(a,b).to.not.be.a("function")},assert.isObject=function(a,b){new Assertion(a,b).to.be.a("object")},assert.isNotObject=function(a,b){new Assertion(a,b).to.not.be.a("object")},assert.isArray=function(a,b){new Assertion(a,b).to.be.an("array")},assert.isNotArray=function(a,b){new Assertion(a,b).to.not.be.an("array")},assert.isString=function(a,b){new Assertion(a,b).to.be.a("string")},assert.isNotString=function(a,b){new Assertion(a,b).to.not.be.a("string")},assert.isNumber=function(a,b){new Assertion(a,b).to.be.a("number")},assert.isNotNumber=function(a,b){new Assertion(a,b).to.not.be.a("number")},assert.isBoolean=function(a,b){new Assertion(a,b).to.be.a("boolean")},assert.isNotBoolean=function(a,b){new Assertion(a,b).to.not.be.a("boolean")},assert.typeOf=function(a,b,c){new Assertion(a,c).to.be.a(b)},assert.notTypeOf=function(a,b,c){new Assertion(a,c).to.not.be.a(b)},assert.instanceOf=function(a,b,c){new Assertion(a,c).to.be.instanceOf(b)},assert.notInstanceOf=function(a,b,c){new Assertion(a,c).to.not.be.instanceOf(b)},assert.include=function(a,b,c){new Assertion(a,c).include(b)},assert.notInclude=function(a,b,c){new Assertion(a,c).not.include(b)},assert.match=function(a,b,c){new Assertion(a,c).to.match(b)},assert.notMatch=function(a,b,c){new Assertion(a,c).to.not.match(b)},assert.property=function(a,b,c){new Assertion(a,c).to.have.property(b)},assert.notProperty=function(a,b,c){new Assertion(a,c).to.not.have.property(b)},assert.deepProperty=function(a,b,c){new Assertion(a,c).to.have.deep.property(b)},assert.notDeepProperty=function(a,b,c){new Assertion(a,c).to.not.have.deep.property(b)},assert.propertyVal=function(a,b,c,d){new Assertion(a,d).to.have.property(b,c)},assert.propertyNotVal=function(a,b,c,d){new Assertion(a,d).to.not.have.property(b,c)},assert.deepPropertyVal=function(a,b,c,d){new Assertion(a,d).to.have.deep.property(b,c)},assert.deepPropertyNotVal=function(a,b,c,d){new Assertion(a,d).to.not.have.deep.property(b,c)},assert.lengthOf=function(a,b,c){new Assertion(a,c).to.have.length(b)},assert.Throw=function(a,b,c,d){("string"==typeof b||b instanceof RegExp)&&(c=b,b=null);var e=new Assertion(a,d).to.Throw(b,c);return flag(e,"object")},assert.doesNotThrow=function(a,b,c){"string"==typeof b&&(c=b,b=null),new Assertion(a,c).to.not.Throw(b)},assert.operator=function(val,operator,val2,msg){if(!~["==","===",">",">=","<","<=","!=","!=="].indexOf(operator))throw new Error('Invalid operator "'+operator+'"');var test=new Assertion(eval(val+operator+val2),msg);test.assert(!0===flag(test,"object"),"expected "+util.inspect(val)+" to be "+operator+" "+util.inspect(val2),"expected "+util.inspect(val)+" to not be "+operator+" "+util.inspect(val2))},assert.closeTo=function(a,b,c,d){new Assertion(a,d).to.be.closeTo(b,c)},assert.sameMembers=function(a,b,c){new Assertion(a,c).to.have.same.members(b)},assert.includeMembers=function(a,b,c){new Assertion(a,c).to.include.members(b)},assert.ifError=function(a,b){new Assertion(a,b).to.not.be.ok},function a(b,c){return assert[c]=assert[b],a}("Throw","throw")("Throw","throws")}}),require.register("chai/lib/chai/interface/expect.js",function(a,b,c){c.exports=function(a){a.expect=function(b,c){return new a.Assertion(b,c)}}}),require.register("chai/lib/chai/interface/should.js",function(a,b,c){c.exports=function(a){function d(){Object.defineProperty(Object.prototype,"should",{set:function(a){Object.defineProperty(this,"should",{value:a,enumerable:!0,configurable:!0,writable:!0})},get:function(){return this instanceof String||this instanceof Number?new c(this.constructor(this)):this instanceof Boolean?new c(1==this):new c(this)},configurable:!0});var a={};return a.equal=function(a,b,d){new c(a,d).to.equal(b)},a.Throw=function(a,b,d,e){new c(a,e).to.Throw(b,d)},a.exist=function(a,b){new c(a,b).to.exist},a.not={},a.not.equal=function(a,b,d){new c(a,d).to.not.equal(b)},a.not.Throw=function(a,b,d,e){new c(a,e).to.not.Throw(b,d)},a.not.exist=function(a,b){new c(a,b).to.not.exist},a["throw"]=a.Throw,a.not["throw"]=a.not.Throw,a}var c=a.Assertion;a.should=d,a.Should=d}}),require.register("chai/lib/chai/utils/addChainableMethod.js",function(a,b,c){var d=b("./transferFlags"),e="__proto__"in Object,f=/^(?:length|name|arguments|caller)$/,g=Function.prototype.call,h=Function.prototype.apply;c.exports=function(a,b,c,i){"function"!=typeof i&&(i=function(){});var j={method:c,chainingBehavior:i};a.__methods||(a.__methods={}),a.__methods[b]=j,Object.defineProperty(a,b,{get:function(){j.chainingBehavior.call(this);var b=function(){var a=j.method.apply(this,arguments);return void 0===a?this:a};if(e){var c=b.__proto__=Object.create(this);c.call=g,c.apply=h}else{var i=Object.getOwnPropertyNames(a);i.forEach(function(c){if(!f.test(c)){var d=Object.getOwnPropertyDescriptor(a,c);Object.defineProperty(b,c,d)}})}return d(this,b),b},configurable:!0})}}),require.register("chai/lib/chai/utils/addMethod.js",function(a,b,c){c.exports=function(a,b,c){a[b]=function(){var a=c.apply(this,arguments);return void 0===a?this:a}}}),require.register("chai/lib/chai/utils/addProperty.js",function(a,b,c){c.exports=function(a,b,c){Object.defineProperty(a,b,{get:function(){var a=c.call(this);return void 0===a?this:a},configurable:!0})}}),require.register("chai/lib/chai/utils/flag.js",function(a,b,c){c.exports=function(a,b,c){var d=a.__flags||(a.__flags=Object.create(null));return 3!==arguments.length?d[b]:(d[b]=c,void 0)}}),require.register("chai/lib/chai/utils/getActual.js",function(a,b,c){c.exports=function(a,b){var c=b[4];return"undefined"!=typeof c?c:a._obj}}),require.register("chai/lib/chai/utils/getEnumerableProperties.js",function(a,b,c){c.exports=function(a){var b=[];for(var c in a)b.push(c);return b}}),require.register("chai/lib/chai/utils/getMessage.js",function(a,b,c){var d=b("./flag"),e=b("./getActual"),g=(b("./inspect"),b("./objDisplay"));c.exports=function(a,b){var c=d(a,"negate"),f=d(a,"object"),h=b[3],i=e(a,b),j=c?b[2]:b[1],k=d(a,"message");return j=j||"",j=j.replace(/#{this}/g,g(f)).replace(/#{act}/g,g(i)).replace(/#{exp}/g,g(h)),k?k+": "+j:j}}),require.register("chai/lib/chai/utils/getName.js",function(a,b,c){c.exports=function(a){if(a.name)return a.name;var b=/^\s?function ([^(]*)\(/.exec(a);return b&&b[1]?b[1]:""}}),require.register("chai/lib/chai/utils/getPathValue.js",function(a,b,c){function e(a){var b=a.replace(/\[/g,".["),c=b.match(/(\\\.|[^.]+?)+/g);return c.map(function(a){var b=/\[(\d+)\]$/,c=b.exec(a);return c?{i:parseFloat(c[1])}:{p:a}})}function f(a,b){for(var d,c=b,e=0,f=a.length;f>e;e++){var g=a[e];c?("undefined"!=typeof g.p?c=c[g.p]:"undefined"!=typeof g.i&&(c=c[g.i]),e==f-1&&(d=c)):d=void 0}return d}c.exports=function(a,b){var c=e(a);return f(c,b)}}),require.register("chai/lib/chai/utils/getProperties.js",function(a,b,c){c.exports=function(){function c(a){-1===b.indexOf(a)&&b.push(a)}for(var b=Object.getOwnPropertyNames(subject),d=Object.getPrototypeOf(subject);null!==d;)Object.getOwnPropertyNames(d).forEach(c),d=Object.getPrototypeOf(d);return b}}),require.register("chai/lib/chai/utils/index.js",function(a,b,c){var a=c.exports={};a.test=b("./test"),a.type=b("./type"),a.getMessage=b("./getMessage"),a.getActual=b("./getActual"),a.inspect=b("./inspect"),a.objDisplay=b("./objDisplay"),a.flag=b("./flag"),a.transferFlags=b("./transferFlags"),a.eql=b("deep-eql"),a.getPathValue=b("./getPathValue"),a.getName=b("./getName"),a.addProperty=b("./addProperty"),a.addMethod=b("./addMethod"),a.overwriteProperty=b("./overwriteProperty"),a.overwriteMethod=b("./overwriteMethod"),a.addChainableMethod=b("./addChainableMethod"),a.overwriteChainableMethod=b("./overwriteChainableMethod")}),require.register("chai/lib/chai/utils/inspect.js",function(a,b,c){function g(a,b,c){var e={showHidden:b,seen:[],stylize:function(a){return a}};return j(e,a,"undefined"==typeof c?2:c)}function j(b,c,g){if(c&&"function"==typeof c.inspect&&c.inspect!==a.inspect&&(!c.constructor||c.constructor.prototype!==c)){var t=c.inspect(g);return"string"!=typeof t&&(t=j(b,t,g)),t}var u=k(b,c);if(u)return u;if(i(c))return h(c);var v=f(c),w=b.showHidden?e(c):v;if(0===w.length||s(c)&&(1===w.length&&"stack"===w[0]||2===w.length&&"description"===w[0]&&"stack"===w[1])){if("function"==typeof c){var x=d(c),y=x?": "+x:"";return b.stylize("[Function"+y+"]","special")}if(q(c))return b.stylize(RegExp.prototype.toString.call(c),"regexp");if(r(c))return b.stylize(Date.prototype.toUTCString.call(c),"date");if(s(c))return l(c)}var z="",A=!1,B=["{","}"];if(p(c)&&(A=!0,B=["[","]"]),"function"==typeof c){var x=d(c),y=x?": "+x:"";z=" [Function"+y+"]"}if(q(c)&&(z=" "+RegExp.prototype.toString.call(c)),r(c)&&(z=" "+Date.prototype.toUTCString.call(c)),s(c))return l(c);if(0===w.length&&(!A||0==c.length))return B[0]+z+B[1];if(0>g)return q(c)?b.stylize(RegExp.prototype.toString.call(c),"regexp"):b.stylize("[Object]","special");b.seen.push(c);var C;return C=A?m(b,c,g,v,w):w.map(function(a){return n(b,c,g,v,a,A)}),b.seen.pop(),o(C,z,B)}function k(a,b){switch(typeof b){case"undefined":return a.stylize("undefined","undefined");case"string":var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string");case"number":return a.stylize(""+b,"number");case"boolean":return a.stylize(""+b,"boolean")}return null===b?a.stylize("null","null"):void 0}function l(a){return"["+Error.prototype.toString.call(a)+"]"}function m(a,b,c,d,e){for(var f=[],g=0,h=b.length;h>g;++g)Object.prototype.hasOwnProperty.call(b,String(g))?f.push(n(a,b,c,d,String(g),!0)):f.push("");return e.forEach(function(e){e.match(/^\d+$/)||f.push(n(a,b,c,d,e,!0))}),f}function n(a,b,c,d,e,f){var g,h;if(b.__lookupGetter__&&(b.__lookupGetter__(e)?h=b.__lookupSetter__(e)?a.stylize("[Getter/Setter]","special"):a.stylize("[Getter]","special"):b.__lookupSetter__(e)&&(h=a.stylize("[Setter]","special"))),d.indexOf(e)<0&&(g="["+e+"]"),h||(a.seen.indexOf(b[e])<0?(h=null===c?j(a,b[e],null):j(a,b[e],c-1),h.indexOf("\n")>-1&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=a.stylize("[Circular]","special")),"undefined"==typeof g){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+h}function o(a,b,c){var d=0,e=a.reduce(function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.length+1},0);return e>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function p(a){return Array.isArray(a)||"object"==typeof a&&"[object Array]"===t(a)}function q(a){return"object"==typeof a&&"[object RegExp]"===t(a)}function r(a){return"object"==typeof a&&"[object Date]"===t(a)}function s(a){return"object"==typeof a&&"[object Error]"===t(a)}function t(a){return Object.prototype.toString.call(a)}var d=b("./getName"),e=b("./getProperties"),f=b("./getEnumerableProperties");c.exports=g;var h=function(a){if("outerHTML"in a)return a.outerHTML;var b="http://www.w3.org/1999/xhtml",c=document.createElementNS(b,"_");(window.HTMLElement||window.Element).prototype;var f,e=new XMLSerializer;return document.xmlVersion?e.serializeToString(a):(c.appendChild(a.cloneNode(!1)),f=c.innerHTML.replace("><",">"+a.innerHTML+"<"),c.innerHTML="",f)},i=function(a){return"object"==typeof HTMLElement?a instanceof HTMLElement:a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName}}),require.register("chai/lib/chai/utils/objDisplay.js",function(a,b,c){var d=b("./inspect");c.exports=function(a){var b=d(a),c=Object.prototype.toString.call(a);if(b.length>=40){if("[object Function]"===c)return a.name&&""!==a.name?"[Function: "+a.name+"]":"[Function]";if("[object Array]"===c)return"[ Array("+a.length+") ]";if("[object Object]"===c){var e=Object.keys(a),f=e.length>2?e.splice(0,2).join(", ")+", ...":e.join(", ");return"{ Object ("+f+") }"}return b}return b}}),require.register("chai/lib/chai/utils/overwriteMethod.js",function(a,b,c){c.exports=function(a,b,c){var d=a[b],e=function(){return this};d&&"function"==typeof d&&(e=d),a[b]=function(){var a=c(e).apply(this,arguments);return void 0===a?this:a}}}),require.register("chai/lib/chai/utils/overwriteProperty.js",function(a,b,c){c.exports=function(a,b,c){var d=Object.getOwnPropertyDescriptor(a,b),e=function(){};d&&"function"==typeof d.get&&(e=d.get),Object.defineProperty(a,b,{get:function(){var a=c(e).call(this);return void 0===a?this:a},configurable:!0})}}),require.register("chai/lib/chai/utils/overwriteChainableMethod.js",function(a,b,c){c.exports=function(a,b,c,d){var e=a.__methods[b],f=e.chainingBehavior;e.chainingBehavior=function(){var a=d(f).call(this);return void 0===a?this:a};var g=e.method;e.method=function(){var a=c(g).apply(this,arguments);return void 0===a?this:a}}}),require.register("chai/lib/chai/utils/test.js",function(a,b,c){var d=b("./flag");c.exports=function(a,b){var c=d(a,"negate"),e=b[0];return c?!e:e}}),require.register("chai/lib/chai/utils/transferFlags.js",function(a,b,c){c.exports=function(a,b,c){var d=a.__flags||(a.__flags=Object.create(null));b.__flags||(b.__flags=Object.create(null)),c=3===arguments.length?c:!0;for(var e in d)(c||"object"!==e&&"ssfi"!==e&&"message"!=e)&&(b.__flags[e]=d[e])}}),require.register("chai/lib/chai/utils/type.js",function(a,b,c){var d={"[object Arguments]":"arguments","[object Array]":"array","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object RegExp]":"regexp","[object String]":"string"};c.exports=function(a){var b=Object.prototype.toString.call(a);return d[b]?d[b]:null===a?"null":void 0===a?"undefined":a===Object(a)?"object":typeof a}}),require.alias("chaijs-assertion-error/index.js","chai/deps/assertion-error/index.js"),require.alias("chaijs-assertion-error/index.js","chai/deps/assertion-error/index.js"),require.alias("chaijs-assertion-error/index.js","assertion-error/index.js"),require.alias("chaijs-assertion-error/index.js","chaijs-assertion-error/index.js"),require.alias("chaijs-deep-eql/lib/eql.js","chai/deps/deep-eql/lib/eql.js"),require.alias("chaijs-deep-eql/lib/eql.js","chai/deps/deep-eql/index.js"),require.alias("chaijs-deep-eql/lib/eql.js","deep-eql/index.js"),require.alias("chaijs-type-detect/lib/type.js","chaijs-deep-eql/deps/type-detect/lib/type.js"),require.alias("chaijs-type-detect/lib/type.js","chaijs-deep-eql/deps/type-detect/index.js"),require.alias("chaijs-type-detect/lib/type.js","chaijs-type-detect/index.js"),require.alias("chaijs-deep-eql/lib/eql.js","chaijs-deep-eql/index.js"),require.alias("chai/index.js","chai/index.js"),"object"==typeof exports?module.exports=require("chai"):"function"==typeof define&&define.amd?define([],function(){return require("chai")
+}):this.chai=require("chai")}();
View
41 ajax/libs/chai/package.json
@@ -0,0 +1,41 @@
+{
+ "author": "Jake Luer <jake@alogicalparadox.com>",
+ "name": "chai",
+ "filename": "chai.js",
+ "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.",
+ "keywords": [ "test", "assertion", "assert", "testing", "chai" ],
+ "homepage": "http://chaijs.com",
+ "license": "MIT",
+ "contributors": [
+ "Jake Luer <jake@alogicalparadox.com>",
+ "Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com)",
+ "Veselin Todorov <hi@vesln.com>",
+ "John Firebaugh <john.firebaugh@gmail.com>"
+ ],
+ "version": "1.9.0",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/chaijs/chai"
+ },
+ "bugs":"https://github.com/chaijs/chai/issues",
+ "main": "./index",
+ "scripts": {
+ "test": "make test"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ },
+ "dependencies": {
+ "assertion-error": "1.0.0"
+ , "deep-eql": "0.1.3"
+ },
+ "devDependencies": {
+ "component": "*"
+ , "karma": "0.11.12"
+ , "karma-mocha": "*"
+ , "karma-sauce-launcher": "0.2.0"
+ , "karma-phantomjs-launcher": "0.1.1"
+ , "mocha": "1.8.2"
+ , "istanbul": "~0.1.44"
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.