diff --git a/chai.js b/chai.js index 3aea7626b..792edbae9 100644 --- a/chai.js +++ b/chai.js @@ -510,7 +510,7 @@ module.exports = function (chai, _) { * Object.prototype.b = 2; * * expect({a: 1}).to.have.own.property('a'); - * expect({a: 1}).to.have.property('b').but.not.own.property('b'); + * expect({a: 1}).to.have.property('b').but.not.own.property('b'); * * expect({a: 1}).to.own.include({a: 1}); * expect({a: 1}).to.include({b: 2}).but.not.own.include({b: 2}); @@ -643,7 +643,7 @@ module.exports = function (chai, _) { * expect(1, 'nooo why fail??').to.be.a('string'); * * `.a` can also be used as a language chain to improve the readability of - * your assertions. + * your assertions. * * expect({b: 2}).to.have.a.property('b'); * @@ -757,7 +757,7 @@ module.exports = function (chai, _) { * * expect('foobar').to.not.include('taco'); * expect([1, 2, 3]).to.not.include(4); - * + * * However, it's dangerous to negate `.include` when the target is an object. * The problem is that it creates uncertain expectations by asserting that the * target object doesn't have all of `val`'s key/value pairs but may or may @@ -830,7 +830,7 @@ module.exports = function (chai, _) { function include (val, msg) { if (msg) flag(this, 'message', msg); - + var obj = flag(this, 'object') , objType = _.type(obj).toLowerCase() , flagMsg = flag(this, 'message') @@ -903,17 +903,17 @@ module.exports = function (chai, _) { var props = Object.keys(val) , firstErr = null , numErrs = 0; - + props.forEach(function (prop) { var propAssertion = new Assertion(obj); _.transferFlags(this, propAssertion, true); flag(propAssertion, 'lockSsfi', true); - + if (!negate || props.length === 1) { propAssertion.property(prop, val[prop]); return; } - + try { propAssertion.property(prop, val[prop]); } catch (err) { @@ -924,7 +924,7 @@ module.exports = function (chai, _) { numErrs++; } }, this); - + // When validating .not.include with multiple properties, we only want // to throw an assertion error if all of the properties are included, // in which case we throw the first property assertion error that we @@ -1336,7 +1336,7 @@ module.exports = function (chai, _) { * * expect(1).to.equal(1); * expect('foo').to.equal('foo'); - * + * * Add `.deep` earlier in the chain to use deep equality instead. See the * `deep-eql` project page for info on the deep equality algorithm: * https://github.com/chaijs/deep-eql. @@ -1508,7 +1508,7 @@ module.exports = function (chai, _) { if (doLength) { new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); } - + if (!doLength && (objType === 'date' && nType !== 'date')) { errorMessage = msgPrefix + 'the argument to above must be a date'; } else if (nType !== 'number' && (doLength || objType === 'number')) { @@ -1794,7 +1794,7 @@ module.exports = function (chai, _) { if (doLength) { new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); } - + if (!doLength && (objType === 'date' && nType !== 'date')) { errorMessage = msgPrefix + 'the argument to most must be a date'; } else if (nType !== 'number' && (doLength || objType === 'number')) { @@ -2030,7 +2030,7 @@ module.exports = function (chai, _) { * * expect({a: 1}).to.have.own.property('a'); * expect({a: 1}).to.have.own.property('a', 1); - * expect({a: 1}).to.have.property('b').but.not.own.property('b'); + * expect({a: 1}).to.have.property('b').but.not.own.property('b'); * * `.deep` and `.own` can be combined. * @@ -2057,7 +2057,7 @@ module.exports = function (chai, _) { * Add `.not` earlier in the chain to negate `.property`. * * expect({a: 1}).to.not.have.property('b'); - * + * * However, it's dangerous to negate `.property` when providing `val`. The * problem is that it creates uncertain expectations by asserting that the * target either doesn't have a property with the given key `name`, or that it @@ -2095,7 +2095,7 @@ module.exports = function (chai, _) { * * // Not recommended * expect({a: 1}).to.have.property('b', undefined, 'nooo why fail??'); - * + * * The above assertion isn't the same thing as not providing `val`. Instead, * it's asserting that the target object has a `b` property that's equal to * `undefined`. @@ -2214,7 +2214,7 @@ module.exports = function (chai, _) { * Add `.not` earlier in the chain to negate `.ownPropertyDescriptor`. * * expect({a: 1}).to.not.have.ownPropertyDescriptor('b'); - * + * * However, it's dangerous to negate `.ownPropertyDescriptor` when providing * a `descriptor`. The problem is that it creates uncertain expectations by * asserting that the target either doesn't have a property descriptor with @@ -2285,7 +2285,7 @@ module.exports = function (chai, _) { * writable: true, * value: 2, * }); - * + * * // Recommended * expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('b'); * @@ -2502,7 +2502,7 @@ module.exports = function (chai, _) { * ### .keys(key1[, key2[, ...]]) * * Asserts that the target object, array, map, or set has the given keys. Only - * the target's own inherited properties are included in the search. + * the target's own inherited properties are included in the search. * * When the target is an object or array, keys can be provided as one or more * string arguments, a single array argument, or a single object argument. In @@ -2737,7 +2737,7 @@ module.exports = function (chai, _) { * * When no arguments are provided, `.throw` invokes the target function and * asserts that an error is thrown. - * + * * var badFn = function () { throw new TypeError('Illegal salmon!'); }; * * expect(badFn).to.throw(); @@ -2789,11 +2789,11 @@ module.exports = function (chai, _) { * expect(badFn).to.throw(err, /salmon/); * * Add `.not` earlier in the chain to negate `.throw`. - * + * * var goodFn = function () {}; * * expect(goodFn).to.not.throw(); - * + * * However, it's dangerous to negate `.throw` when providing any arguments. * The problem is that it creates uncertain expectations by asserting that the * target either doesn't throw an error, or that it throws an error but of a @@ -3141,7 +3141,7 @@ module.exports = function (chai, _) { * first argument, and asserts that the value returned is truthy. * * expect(1).to.satisfy(function(num) { - * return num > 0; + * return num > 0; * }); * * Add `.not` earlier in the chain to negate `.satisfy`. @@ -3610,7 +3610,7 @@ module.exports = function (chai, _) { * * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended * expect(subtractTwo).to.not.increase(myObj, 'val'); // Not recommended - * + * * When the subject is expected to stay the same, it's often best to assert * exactly that. * @@ -3707,7 +3707,7 @@ module.exports = function (chai, _) { * * When two arguments are provided, `.decrease` asserts that the value of the * given object `subject`'s `prop` property is lesser after invoking the - * target function compared to beforehand. + * target function compared to beforehand. * * var myObj = {val: 1} * , subtractTwo = function () { myObj.val -= 2; }; @@ -3729,7 +3729,7 @@ module.exports = function (chai, _) { * * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended * expect(addTwo).to.not.decrease(myObj, 'val'); // Not recommended - * + * * When the subject is expected to stay the same, it's often best to assert * exactly that. * @@ -5106,24 +5106,24 @@ module.exports = function (chai, util) { /** * ### .nestedInclude(haystack, needle, [message]) - * - * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the inclusion of a subset of properties in an + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an * object. - * Enables the use of dot- and bracket-notation for referencing nested + * Enables the use of dot- and bracket-notation for referencing nested * properties. * '[]' and '.' in property names can be escaped using double backslashes. - * + * * assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'}); * assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'}); - * + * * @name nestedInclude * @param {Object} haystack * @param {Object} needle * @param {String} message * @namespace Assert - * @api public - */ + * @api public + */ assert.nestedInclude = function (exp, inc, msg) { new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc); @@ -5131,24 +5131,24 @@ module.exports = function (chai, util) { /** * ### .notNestedInclude(haystack, needle, [message]) - * - * Asserts that 'haystack' does not include 'needle'. - * Can be used to assert the absence of a subset of properties in an + * + * Asserts that 'haystack' does not include 'needle'. + * Can be used to assert the absence of a subset of properties in an * object. - * Enables the use of dot- and bracket-notation for referencing nested - * properties. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. * '[]' and '.' in property names can be escaped using double backslashes. - * + * * assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.b': 'y'}); * assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'}); - * + * * @name notNestedInclude * @param {Object} haystack * @param {Object} needle * @param {String} message * @namespace Assert - * @api public - */ + * @api public + */ assert.notNestedInclude = function (exp, inc, msg) { new Assertion(exp, msg, assert.notNestedInclude, true) @@ -5157,23 +5157,23 @@ module.exports = function (chai, util) { /** * ### .deepNestedInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the inclusion of a subset of properties in an + * Can be used to assert the inclusion of a subset of properties in an * object while checking for deep equality. - * Enables the use of dot- and bracket-notation for referencing nested + * Enables the use of dot- and bracket-notation for referencing nested * properties. * '[]' and '.' in property names can be escaped using double backslashes. - * + * * assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}}); * assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}}); - * + * * @name deepNestedInclude * @param {Object} haystack * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @api public */ assert.deepNestedInclude = function(exp, inc, msg) { @@ -5183,23 +5183,23 @@ module.exports = function (chai, util) { /** * ### .notDeepNestedInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' does not include 'needle'. - * Can be used to assert the absence of a subset of properties in an + * Can be used to assert the absence of a subset of properties in an * object while checking for deep equality. - * Enables the use of dot- and bracket-notation for referencing nested + * Enables the use of dot- and bracket-notation for referencing nested * properties. * '[]' and '.' in property names can be escaped using double backslashes. - * + * * assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}}) * assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}}); - * + * * @name notDeepNestedInclude * @param {Object} haystack * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @api public */ assert.notDeepNestedInclude = function(exp, inc, msg) { @@ -5209,13 +5209,13 @@ module.exports = function (chai, util) { /** * ### .ownInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the inclusion of a subset of properties in an + * Can be used to assert the inclusion of a subset of properties in an * object while ignoring inherited properties. - * + * * assert.ownInclude({ a: 1 }, { a: 1 }); - * + * * @name ownInclude * @param {Object} haystack * @param {Object} needle @@ -5230,15 +5230,15 @@ module.exports = function (chai, util) { /** * ### .notOwnInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the absence of a subset of properties in an + * Can be used to assert the absence of a subset of properties in an * object while ignoring inherited properties. - * + * * Object.prototype.b = 2; - * + * * assert.notOwnInclude({ a: 1 }, { b: 2 }); - * + * * @name notOwnInclude * @param {Object} haystack * @param {Object} needle @@ -5253,13 +5253,13 @@ module.exports = function (chai, util) { /** * ### .deepOwnInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the inclusion of a subset of properties in an + * Can be used to assert the inclusion of a subset of properties in an * object while ignoring inherited properties and checking for deep equality. - * + * * assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}}); - * + * * @name deepOwnInclude * @param {Object} haystack * @param {Object} needle @@ -5275,13 +5275,13 @@ module.exports = function (chai, util) { /** * ### .notDeepOwnInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the absence of a subset of properties in an + * Can be used to assert the absence of a subset of properties in an * object while ignoring inherited properties and checking for deep equality. - * + * * assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}}); - * + * * @name notDeepOwnInclude * @param {Object} haystack * @param {Object} needle @@ -7801,7 +7801,7 @@ module.exports = function addProperty(ctx, name, getter) { */ /*! - * Module dependancies + * Module dependencies */ var inspect = require('./inspect'); @@ -7816,7 +7816,7 @@ var inspect = require('./inspect'); * * @param {Mixed} first element to compare * @param {Mixed} second element to compare - * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1 + * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1 * @name compareByInspect * @namespace Utils * @api public @@ -7972,7 +7972,7 @@ module.exports = function getEnumerableProperties(object) { */ /*! - * Module dependancies + * Module dependencies */ var flag = require('./flag') @@ -8025,7 +8025,7 @@ module.exports = function getMessage(obj, args) { */ /*! - * Module dependancies + * Module dependencies */ var getOwnEnumerablePropertySymbols = require('./getOwnEnumerablePropertySymbols'); @@ -8723,7 +8723,7 @@ var config = require('../config'); */ module.exports = function isProxyEnabled() { - return config.useProxy && + return config.useProxy && typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined'; }; @@ -8736,7 +8736,7 @@ module.exports = function isProxyEnabled() { */ /*! - * Module dependancies + * Module dependencies */ var inspect = require('./inspect'); @@ -9060,7 +9060,7 @@ var isProxyEnabled = require('./isProxyEnabled'); * the list of existing properties. However, if a nonChainableMethodName is * provided, then the root cause is instead a failure to invoke a non-chainable * method prior to reading the non-existent property. - * + * * If proxies are unsupported or disabled via the user's Chai config, then * return object without modification. * @@ -9174,7 +9174,7 @@ function stringDistance(strA, strB, memo) { */ /*! - * Module dependancies + * Module dependencies */ var flag = require('./flag'); @@ -10704,4 +10704,4 @@ module.exports = function typeDetect(obj) { module.exports.typeDetect = module.exports; },{}]},{},[1])(1) -}); \ No newline at end of file +}); diff --git a/lib/chai/core/assertions.js b/lib/chai/core/assertions.js index 3145e1ba8..968e6e1b2 100644 --- a/lib/chai/core/assertions.js +++ b/lib/chai/core/assertions.js @@ -149,7 +149,7 @@ module.exports = function (chai, _) { * Object.prototype.b = 2; * * expect({a: 1}).to.have.own.property('a'); - * expect({a: 1}).to.have.property('b').but.not.own.property('b'); + * expect({a: 1}).to.have.property('b').but.not.own.property('b'); * * expect({a: 1}).to.own.include({a: 1}); * expect({a: 1}).to.include({b: 2}).but.not.own.include({b: 2}); @@ -281,7 +281,7 @@ module.exports = function (chai, _) { * expect(1, 'nooo why fail??').to.be.a('string'); * * `.a` can also be used as a language chain to improve the readability of - * your assertions. + * your assertions. * * expect({b: 2}).to.have.a.property('b'); * @@ -395,7 +395,7 @@ module.exports = function (chai, _) { * * expect('foobar').to.not.include('taco'); * expect([1, 2, 3]).to.not.include(4); - * + * * However, it's dangerous to negate `.include` when the target is an object. * The problem is that it creates uncertain expectations by asserting that the * target object doesn't have all of `val`'s key/value pairs but may or may @@ -468,7 +468,7 @@ module.exports = function (chai, _) { function include (val, msg) { if (msg) flag(this, 'message', msg); - + var obj = flag(this, 'object') , objType = _.type(obj).toLowerCase() , flagMsg = flag(this, 'message') @@ -541,17 +541,17 @@ module.exports = function (chai, _) { var props = Object.keys(val) , firstErr = null , numErrs = 0; - + props.forEach(function (prop) { var propAssertion = new Assertion(obj); _.transferFlags(this, propAssertion, true); flag(propAssertion, 'lockSsfi', true); - + if (!negate || props.length === 1) { propAssertion.property(prop, val[prop]); return; } - + try { propAssertion.property(prop, val[prop]); } catch (err) { @@ -562,7 +562,7 @@ module.exports = function (chai, _) { numErrs++; } }, this); - + // When validating .not.include with multiple properties, we only want // to throw an assertion error if all of the properties are included, // in which case we throw the first property assertion error that we @@ -974,7 +974,7 @@ module.exports = function (chai, _) { * * expect(1).to.equal(1); * expect('foo').to.equal('foo'); - * + * * Add `.deep` earlier in the chain to use deep equality instead. See the * `deep-eql` project page for info on the deep equality algorithm: * https://github.com/chaijs/deep-eql. @@ -1147,7 +1147,7 @@ module.exports = function (chai, _) { if (doLength) { new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); } - + if (!doLength && (objType === 'date' && nType !== 'date')) { errorMessage = msgPrefix + 'the argument to above must be a date'; } else if (nType !== 'number' && (doLength || objType === 'number')) { @@ -1436,7 +1436,7 @@ module.exports = function (chai, _) { if (doLength) { new Assertion(obj, flagMsg, ssfi, true).to.have.property('length'); } - + if (!doLength && (objType === 'date' && nType !== 'date')) { errorMessage = msgPrefix + 'the argument to most must be a date'; } else if (nType !== 'number' && (doLength || objType === 'number')) { @@ -1673,7 +1673,7 @@ module.exports = function (chai, _) { * * expect({a: 1}).to.have.own.property('a'); * expect({a: 1}).to.have.own.property('a', 1); - * expect({a: 1}).to.have.property('b').but.not.own.property('b'); + * expect({a: 1}).to.have.property('b').but.not.own.property('b'); * * `.deep` and `.own` can be combined. * @@ -1700,7 +1700,7 @@ module.exports = function (chai, _) { * Add `.not` earlier in the chain to negate `.property`. * * expect({a: 1}).to.not.have.property('b'); - * + * * However, it's dangerous to negate `.property` when providing `val`. The * problem is that it creates uncertain expectations by asserting that the * target either doesn't have a property with the given key `name`, or that it @@ -1738,7 +1738,7 @@ module.exports = function (chai, _) { * * // Not recommended * expect({a: 1}).to.have.property('b', undefined, 'nooo why fail??'); - * + * * The above assertion isn't the same thing as not providing `val`. Instead, * it's asserting that the target object has a `b` property that's equal to * `undefined`. @@ -1876,7 +1876,7 @@ module.exports = function (chai, _) { * Add `.not` earlier in the chain to negate `.ownPropertyDescriptor`. * * expect({a: 1}).to.not.have.ownPropertyDescriptor('b'); - * + * * However, it's dangerous to negate `.ownPropertyDescriptor` when providing * a `descriptor`. The problem is that it creates uncertain expectations by * asserting that the target either doesn't have a property descriptor with @@ -1947,7 +1947,7 @@ module.exports = function (chai, _) { * writable: true, * value: 2, * }); - * + * * // Recommended * expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('b'); * @@ -2164,7 +2164,7 @@ module.exports = function (chai, _) { * ### .keys(key1[, key2[, ...]]) * * Asserts that the target object, array, map, or set has the given keys. Only - * the target's own inherited properties are included in the search. + * the target's own inherited properties are included in the search. * * When the target is an object or array, keys can be provided as one or more * string arguments, a single array argument, or a single object argument. In @@ -2398,7 +2398,7 @@ module.exports = function (chai, _) { * * When no arguments are provided, `.throw` invokes the target function and * asserts that an error is thrown. - * + * * var badFn = function () { throw new TypeError('Illegal salmon!'); }; * * expect(badFn).to.throw(); @@ -2450,11 +2450,11 @@ module.exports = function (chai, _) { * expect(badFn).to.throw(err, /salmon/); * * Add `.not` earlier in the chain to negate `.throw`. - * + * * var goodFn = function () {}; * * expect(goodFn).to.not.throw(); - * + * * However, it's dangerous to negate `.throw` when providing any arguments. * The problem is that it creates uncertain expectations by asserting that the * target either doesn't throw an error, or that it throws an error but of a @@ -2802,7 +2802,7 @@ module.exports = function (chai, _) { * first argument, and asserts that the value returned is truthy. * * expect(1).to.satisfy(function(num) { - * return num > 0; + * return num > 0; * }); * * Add `.not` earlier in the chain to negate `.satisfy`. @@ -3270,7 +3270,7 @@ module.exports = function (chai, _) { * * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended * expect(subtractTwo).to.not.increase(myObj, 'val'); // Not recommended - * + * * When the subject is expected to stay the same, it's often best to assert * exactly that. * @@ -3367,7 +3367,7 @@ module.exports = function (chai, _) { * * When two arguments are provided, `.decrease` asserts that the value of the * given object `subject`'s `prop` property is lesser after invoking the - * target function compared to beforehand. + * target function compared to beforehand. * * var myObj = {val: 1} * , subtractTwo = function () { myObj.val -= 2; }; @@ -3389,7 +3389,7 @@ module.exports = function (chai, _) { * * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended * expect(addTwo).to.not.decrease(myObj, 'val'); // Not recommended - * + * * When the subject is expected to stay the same, it's often best to assert * exactly that. * diff --git a/lib/chai/interface/assert.js b/lib/chai/interface/assert.js index 59e5f8b66..03dfd103c 100644 --- a/lib/chai/interface/assert.js +++ b/lib/chai/interface/assert.js @@ -1012,24 +1012,24 @@ module.exports = function (chai, util) { /** * ### .nestedInclude(haystack, needle, [message]) - * - * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the inclusion of a subset of properties in an + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an * object. - * Enables the use of dot- and bracket-notation for referencing nested + * Enables the use of dot- and bracket-notation for referencing nested * properties. * '[]' and '.' in property names can be escaped using double backslashes. - * + * * assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'}); * assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'}); - * + * * @name nestedInclude * @param {Object} haystack * @param {Object} needle * @param {String} message * @namespace Assert - * @api public - */ + * @api public + */ assert.nestedInclude = function (exp, inc, msg) { new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc); @@ -1037,24 +1037,24 @@ module.exports = function (chai, util) { /** * ### .notNestedInclude(haystack, needle, [message]) - * - * Asserts that 'haystack' does not include 'needle'. - * Can be used to assert the absence of a subset of properties in an + * + * Asserts that 'haystack' does not include 'needle'. + * Can be used to assert the absence of a subset of properties in an * object. - * Enables the use of dot- and bracket-notation for referencing nested - * properties. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. * '[]' and '.' in property names can be escaped using double backslashes. - * + * * assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.b': 'y'}); * assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'}); - * + * * @name notNestedInclude * @param {Object} haystack * @param {Object} needle * @param {String} message * @namespace Assert - * @api public - */ + * @api public + */ assert.notNestedInclude = function (exp, inc, msg) { new Assertion(exp, msg, assert.notNestedInclude, true) @@ -1063,23 +1063,23 @@ module.exports = function (chai, util) { /** * ### .deepNestedInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the inclusion of a subset of properties in an + * Can be used to assert the inclusion of a subset of properties in an * object while checking for deep equality. - * Enables the use of dot- and bracket-notation for referencing nested + * Enables the use of dot- and bracket-notation for referencing nested * properties. * '[]' and '.' in property names can be escaped using double backslashes. - * + * * assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}}); * assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}}); - * + * * @name deepNestedInclude * @param {Object} haystack * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @api public */ assert.deepNestedInclude = function(exp, inc, msg) { @@ -1089,23 +1089,23 @@ module.exports = function (chai, util) { /** * ### .notDeepNestedInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' does not include 'needle'. - * Can be used to assert the absence of a subset of properties in an + * Can be used to assert the absence of a subset of properties in an * object while checking for deep equality. - * Enables the use of dot- and bracket-notation for referencing nested + * Enables the use of dot- and bracket-notation for referencing nested * properties. * '[]' and '.' in property names can be escaped using double backslashes. - * + * * assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}}) * assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}}); - * + * * @name notDeepNestedInclude * @param {Object} haystack * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @api public */ assert.notDeepNestedInclude = function(exp, inc, msg) { @@ -1115,13 +1115,13 @@ module.exports = function (chai, util) { /** * ### .ownInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the inclusion of a subset of properties in an + * Can be used to assert the inclusion of a subset of properties in an * object while ignoring inherited properties. - * + * * assert.ownInclude({ a: 1 }, { a: 1 }); - * + * * @name ownInclude * @param {Object} haystack * @param {Object} needle @@ -1136,15 +1136,15 @@ module.exports = function (chai, util) { /** * ### .notOwnInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the absence of a subset of properties in an + * Can be used to assert the absence of a subset of properties in an * object while ignoring inherited properties. - * + * * Object.prototype.b = 2; - * + * * assert.notOwnInclude({ a: 1 }, { b: 2 }); - * + * * @name notOwnInclude * @param {Object} haystack * @param {Object} needle @@ -1159,13 +1159,13 @@ module.exports = function (chai, util) { /** * ### .deepOwnInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the inclusion of a subset of properties in an + * Can be used to assert the inclusion of a subset of properties in an * object while ignoring inherited properties and checking for deep equality. - * + * * assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}}); - * + * * @name deepOwnInclude * @param {Object} haystack * @param {Object} needle @@ -1181,13 +1181,13 @@ module.exports = function (chai, util) { /** * ### .notDeepOwnInclude(haystack, needle, [message]) - * + * * Asserts that 'haystack' includes 'needle'. - * Can be used to assert the absence of a subset of properties in an + * Can be used to assert the absence of a subset of properties in an * object while ignoring inherited properties and checking for deep equality. - * + * * assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}}); - * + * * @name notDeepOwnInclude * @param {Object} haystack * @param {Object} needle diff --git a/lib/chai/utils/compareByInspect.js b/lib/chai/utils/compareByInspect.js index fde48d46c..c8cd5e197 100644 --- a/lib/chai/utils/compareByInspect.js +++ b/lib/chai/utils/compareByInspect.js @@ -5,7 +5,7 @@ */ /*! - * Module dependancies + * Module dependencies */ var inspect = require('./inspect'); @@ -20,7 +20,7 @@ var inspect = require('./inspect'); * * @param {Mixed} first element to compare * @param {Mixed} second element to compare - * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1 + * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1 * @name compareByInspect * @namespace Utils * @api public diff --git a/lib/chai/utils/getMessage.js b/lib/chai/utils/getMessage.js index 61e19b1c3..bb8371668 100644 --- a/lib/chai/utils/getMessage.js +++ b/lib/chai/utils/getMessage.js @@ -5,7 +5,7 @@ */ /*! - * Module dependancies + * Module dependencies */ var flag = require('./flag') diff --git a/lib/chai/utils/getOwnEnumerableProperties.js b/lib/chai/utils/getOwnEnumerableProperties.js index 93a609e9d..a4aa83a4c 100644 --- a/lib/chai/utils/getOwnEnumerableProperties.js +++ b/lib/chai/utils/getOwnEnumerableProperties.js @@ -5,7 +5,7 @@ */ /*! - * Module dependancies + * Module dependencies */ var getOwnEnumerablePropertySymbols = require('./getOwnEnumerablePropertySymbols'); diff --git a/lib/chai/utils/isProxyEnabled.js b/lib/chai/utils/isProxyEnabled.js index aa17dfa82..11e58edfe 100644 --- a/lib/chai/utils/isProxyEnabled.js +++ b/lib/chai/utils/isProxyEnabled.js @@ -18,7 +18,7 @@ var config = require('../config'); */ module.exports = function isProxyEnabled() { - return config.useProxy && + return config.useProxy && typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined'; }; diff --git a/lib/chai/utils/objDisplay.js b/lib/chai/utils/objDisplay.js index 32eacfa70..3010f46df 100644 --- a/lib/chai/utils/objDisplay.js +++ b/lib/chai/utils/objDisplay.js @@ -5,7 +5,7 @@ */ /*! - * Module dependancies + * Module dependencies */ var inspect = require('./inspect'); diff --git a/lib/chai/utils/proxify.js b/lib/chai/utils/proxify.js index 2b3b0203d..fd986d015 100644 --- a/lib/chai/utils/proxify.js +++ b/lib/chai/utils/proxify.js @@ -18,7 +18,7 @@ var isProxyEnabled = require('./isProxyEnabled'); * the list of existing properties. However, if a nonChainableMethodName is * provided, then the root cause is instead a failure to invoke a non-chainable * method prior to reading the non-existent property. - * + * * If proxies are unsupported or disabled via the user's Chai config, then * return object without modification. * diff --git a/lib/chai/utils/test.js b/lib/chai/utils/test.js index 6c4fc4a69..09886d443 100644 --- a/lib/chai/utils/test.js +++ b/lib/chai/utils/test.js @@ -5,7 +5,7 @@ */ /*! - * Module dependancies + * Module dependencies */ var flag = require('./flag'); diff --git a/test/assert.js b/test/assert.js index 5197f2ef4..d23cb3709 100644 --- a/test/assert.js +++ b/test/assert.js @@ -2086,7 +2086,7 @@ describe('assert', function () { err(function() { assert.isAbove(now, now, 'blah'); }, 'blah: expected ' + now.toUTCString() + ' to be above ' + now.toUTCString()); - + err(function() { assert.isAbove(null, now); }, 'expected null to be a number or a date'); diff --git a/test/configuration.js b/test/configuration.js index d37c9ffa9..1f929d110 100644 --- a/test/configuration.js +++ b/test/configuration.js @@ -87,281 +87,281 @@ describe('configuration', function () { describe('when true', function () { describe('failed property assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badPropertyAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('propertyGetter'); - + if (typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined') { expect(caughtErr.stack).to.contain('proxyGetter'); } }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badPropertyAssertion'); }); }); - + describe('failed overwritten property assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badOverwrittenPropertyAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('overwritingPropertyGetter'); - + if (typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined') { expect(caughtErr.stack).to.contain('proxyGetter'); } }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenPropertyAssertion'); }); }); - + describe('failed method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('methodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badMethodAssertion'); }); }); - + describe('failed overwritten method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badOverwrittenMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('overwritingMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenMethodAssertion'); }); }); - + describe('failed chainable method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badChainableMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('chainableMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badChainableMethodAssertion'); }); }); - + describe('failed overwritten chainable method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badOverwrittenChainableMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('overwritingChainableMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenChainableMethodAssertion'); }); }); }); - + describe('when false', function () { describe('failed property assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badPropertyAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('propertyGetter'); - + if (typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined') { expect(caughtErr.stack).to.not.contain('proxyGetter'); } }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badPropertyAssertion'); }); }); - + describe('failed overwritten property assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badOverwrittenPropertyAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('overwritingPropertyGetter'); - + if (typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined') { expect(caughtErr.stack).to.not.contain('proxyGetter'); } }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenPropertyAssertion'); }); }); - + describe('failed method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('methodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badMethodAssertion'); }); }); - + describe('failed overwritten method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badOverwrittenMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('overwritingMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenMethodAssertion'); }); }); - + describe('failed chainable method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badChainableMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('chainableMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badChainableMethodAssertion'); }); }); - + describe('failed overwritten chainable method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badOverwrittenChainableMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('overwritingChainableMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenChainableMethodAssertion'); }); @@ -393,281 +393,281 @@ describe('configuration', function () { describe('when true', function () { describe('failed property assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badPropertyAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('propertyGetter'); - + if (typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined') { expect(caughtErr.stack).to.contain('proxyGetter'); } }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badPropertyAssertion'); }); }); - + describe('failed overwritten property assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badOverwrittenPropertyAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('overwritingPropertyGetter'); - + if (typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined') { expect(caughtErr.stack).to.contain('proxyGetter'); } }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenPropertyAssertion'); }); }); - + describe('failed method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('methodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badMethodAssertion'); }); }); - + describe('failed overwritten method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badOverwrittenMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('overwritingMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenMethodAssertion'); }); }); - + describe('failed chainable method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badChainableMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('chainableMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badChainableMethodAssertion'); }); }); - + describe('failed overwritten chainable method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = true; - + try { badOverwrittenChainableMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should include Chai frames in stack trace', function () { expect(caughtErr.stack).to.contain('overwritingChainableMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenChainableMethodAssertion'); }); }); }); - + describe('when false', function () { describe('failed property assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badPropertyAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('propertyGetter'); - + if (typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined') { expect(caughtErr.stack).to.not.contain('proxyGetter'); } }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badPropertyAssertion'); }); }); - + describe('failed overwritten property assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badOverwrittenPropertyAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('overwritingPropertyGetter'); - + if (typeof Proxy !== 'undefined' && typeof Reflect !== 'undefined') { expect(caughtErr.stack).to.not.contain('proxyGetter'); } }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenPropertyAssertion'); }); }); - + describe('failed method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('methodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badMethodAssertion'); }); }); - + describe('failed overwritten method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badOverwrittenMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('overwritingMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenMethodAssertion'); }); }); - + describe('failed chainable method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badChainableMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('chainableMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badChainableMethodAssertion'); }); }); - + describe('failed overwritten chainable method assertions', function () { var caughtErr = '__PRETEST__'; - + before(function () { chai.config.includeStack = false; - + try { badOverwrittenChainableMethodAssertion(); } catch (err) { caughtErr = err; } }); - + it('should not include Chai frames in stack trace', function () { expect(caughtErr.stack).to.not.contain('overwritingChainableMethodWrapper'); }); - + it('should include user frames in stack trace', function () { expect(caughtErr.stack).to.contain('badOverwrittenChainableMethodAssertion'); }); diff --git a/test/expect.js b/test/expect.js index bb4fcbfca..dd16994a0 100644 --- a/test/expect.js +++ b/test/expect.js @@ -553,7 +553,7 @@ describe('expect', function () { var nowUTC = now.toUTCString(); var beforeUTC = oneSecondAgo.toUTCString(); var afterUTC = oneSecondAfter.toUTCString(); - + expect(now).to.be.within(oneSecondAgo, oneSecondAfter); expect(now).to.be.within(now, oneSecondAfter); expect(now).to.be.within(now, now); @@ -586,7 +586,7 @@ describe('expect', function () { err(function () { expect(now).to.be.within(now, undefined, 'blah'); }, "blah: the arguments to within must be dates"); - + err(function () { expect(now, 'blah').to.be.within(1, now); }, "blah: the arguments to within must be dates"); @@ -1885,7 +1885,7 @@ describe('expect', function () { expect({a: 1}).to.include({'toString': Object.prototype.toString}); // .include should work with Error objects and objects with a custom - // `@@toStringTag`. + // `@@toStringTag`. expect(new Error('foo')).to.include({message: 'foo'}); if (typeof Symbol !== 'undefined' && typeof Symbol.toStringTag !== 'undefined') { diff --git a/test/globalErr.js b/test/globalErr.js index 83d66f4fc..2641c2aaf 100644 --- a/test/globalErr.js +++ b/test/globalErr.js @@ -4,7 +4,7 @@ describe('globalErr', function () { , expect = chai.expect; it('should pass if string val equals error message', function () { - err(function () { + err(function () { expect('cat').to.equal('dog') }, 'expected \'cat\' to equal \'dog\''); }); diff --git a/test/utilities.js b/test/utilities.js index 50963f2f1..95d2a1e61 100644 --- a/test/utilities.js +++ b/test/utilities.js @@ -163,7 +163,7 @@ describe('utilities', function () { var newSsfi = utils.flag(newAssertion, 'ssfi'); expect(origSsfi).to.not.equal(newSsfi); - }); + }); it('addMethod doesn\'t set `ssfi` when `lockSsfi` is set', function () { var origAssertion = expect(1); @@ -348,7 +348,7 @@ describe('utilities', function () { var newSsfi = utils.flag(newAssertion, 'ssfi'); expect(origSsfi).to.not.equal(newSsfi); - }); + }); it('overwriteMethod doesn\'t set `ssfi` when `lockSsfi` is set', function () { var origAssertion = expect(4); @@ -444,7 +444,7 @@ describe('utilities', function () { var newSsfi = utils.flag(newAssertion, 'ssfi'); expect(origSsfi).to.not.equal(newSsfi); - }); + }); it('addProperty doesn\'t set `ssfi` when `lockSsfi` is set', function () { var origAssertion = expect(1); @@ -604,7 +604,7 @@ describe('utilities', function () { var newSsfi = utils.flag(newAssertion, 'ssfi'); expect(origSsfi).to.not.equal(newSsfi); - }); + }); it('overwriteProperty doesn\'t set `ssfi` when `lockSsfi` is set', function () { var origAssertion = expect(4); @@ -911,7 +911,7 @@ describe('utilities', function () { var newSsfi = utils.flag(newAssertion, 'ssfi'); expect(origSsfi).to.not.equal(newSsfi); - }); + }); it('addChainableMethod doesn\'t set `ssfi` when `lockSsfi` is set', function () { var origAssertion = expect('x'); @@ -1039,7 +1039,7 @@ describe('utilities', function () { var newSsfi = utils.flag(newAssertion, 'ssfi'); expect(origSsfi).to.not.equal(newSsfi); - }); + }); it('overwriteChainableMethod doesn\'t set `ssfi` when `lockSsfi` is set', function () { var origAssertion = expect('x'); @@ -1206,7 +1206,7 @@ describe('utilities', function () { it('throws invalid use error if a non-existent property is read when nonChainableMethodName is set', function () { var bake = proxify(function () {}, 'bake'); - + expect(function () { bake.numPizzas; }).to.throw('Invalid Chai property: bake.numPizzas. See docs for proper usage of "bake".'); @@ -1268,15 +1268,15 @@ describe('utilities', function () { it('throws invalid use error if `.length` is read when `methodName` is defined and `isChainable` is false', function () { var hoagie = addLengthGuard({}, 'hoagie', false); - + expect(function () { hoagie.length; }).to.throw('Invalid Chai property: hoagie.length. See docs for proper usage of "hoagie".'); }); - + it('throws incompatible `.length` error if `.length` is read when `methodName` is defined and `isChainable` is true', function () { var hoagie = addLengthGuard({}, 'hoagie', true); - + expect(function () { hoagie.length; }).to.throw('Invalid Chai property: hoagie.length. Due to a compatibility issue, "length" cannot directly follow "hoagie". Use "hoagie.lengthOf" instead.');