From e7f768e1d6061cf9efc5872f3420b58614883a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Thu, 1 Feb 2024 07:50:39 +0100 Subject: [PATCH] Cleanup jsdoc comments (#1596) * Remove unused import * Replace unknown tag `@api public` with `@public` * Remove empty line between jsdoc comment and function * Replace all instance of type `Mixed` with `unknown` * Set correct namespace for expect --- lib/chai/interface/assert.js | 560 +++++++++++++---------------------- lib/chai/interface/expect.js | 10 +- lib/chai/interface/should.js | 33 +-- 3 files changed, 232 insertions(+), 371 deletions(-) diff --git a/lib/chai/interface/assert.js b/lib/chai/interface/assert.js index 24ceff36..e802e79a 100644 --- a/lib/chai/interface/assert.js +++ b/lib/chai/interface/assert.js @@ -8,7 +8,6 @@ import * as chai from '../../../index.js'; import {Assertion} from '../assertion.js'; import {flag, inspect} from '../utils/index.js'; import {AssertionError} from 'assertion-error'; -import {type} from '../utils/type-detect.js'; /** * ### assert(expression, message) @@ -18,13 +17,12 @@ import {type} from '../utils/type-detect.js'; * assert('foo' !== 'bar', 'foo is not bar'); * assert(Array.isArray([]), 'empty arrays are arrays'); * - * @param {Mixed} expression to test for truthiness + * @param {unknown} expression to test for truthiness * @param {String} message to display on error * @name assert * @namespace Assert - * @api public + * @public */ - function assert(express, errmsg) { var test = new Assertion(null, null, chai.assert, true); test.assert( @@ -50,14 +48,13 @@ export {assert}; * assert.fail(1, 2, undefined, ">"); * * @name fail - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @param {String} operator * @namespace Assert - * @api public + * @public */ - assert.fail = function (actual, expected, message, operator) { if (arguments.length < 2) { // Comply with Node's fail([message]) interface @@ -84,12 +81,11 @@ assert.fail = function (actual, expected, message, operator) { * * @name isOk * @alias ok - * @param {Mixed} object to test + * @param {unknown} object to test * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isOk = function (val, msg) { new Assertion(val, msg, assert.isOk, true).is.ok; }; @@ -104,12 +100,11 @@ assert.isOk = function (val, msg) { * * @name isNotOk * @alias notOk - * @param {Mixed} object to test + * @param {unknown} object to test * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNotOk = function (val, msg) { new Assertion(val, msg, assert.isNotOk, true).is.not.ok; }; @@ -122,13 +117,12 @@ assert.isNotOk = function (val, msg) { * assert.equal(3, '3', '== coerces values to strings'); * * @name equal - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.equal = function (act, exp, msg) { var test = new Assertion(act, msg, assert.equal, true); @@ -150,13 +144,12 @@ assert.equal = function (act, exp, msg) { * assert.notEqual(3, 4, 'these numbers are not equal'); * * @name notEqual - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notEqual = function (act, exp, msg) { var test = new Assertion(act, msg, assert.notEqual, true); @@ -178,13 +171,12 @@ assert.notEqual = function (act, exp, msg) { * assert.strictEqual(true, true, 'these booleans are strictly equal'); * * @name strictEqual - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.strictEqual = function (act, exp, msg) { new Assertion(act, msg, assert.strictEqual, true).to.equal(exp); }; @@ -197,13 +189,12 @@ assert.strictEqual = function (act, exp, msg) { * assert.notStrictEqual(3, '3', 'no coercion for strict equality'); * * @name notStrictEqual - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notStrictEqual = function (act, exp, msg) { new Assertion(act, msg, assert.notStrictEqual, true).to.not.equal(exp); }; @@ -216,14 +207,13 @@ assert.notStrictEqual = function (act, exp, msg) { * assert.deepEqual({ tea: 'green' }, { tea: 'green' }); * * @name deepEqual - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @alias deepStrictEqual * @namespace Assert - * @api public + * @public */ - assert.deepEqual = assert.deepStrictEqual = function (act, exp, msg) { new Assertion(act, msg, assert.deepEqual, true).to.eql(exp); }; @@ -236,13 +226,12 @@ assert.deepEqual = assert.deepStrictEqual = function (act, exp, msg) { * assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' }); * * @name notDeepEqual - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notDeepEqual = function (act, exp, msg) { new Assertion(act, msg, assert.notDeepEqual, true).to.not.eql(exp); }; @@ -255,13 +244,12 @@ assert.notDeepEqual = function (act, exp, msg) { * assert.isAbove(5, 2, '5 is strictly greater than 2'); * * @name isAbove - * @param {Mixed} valueToCheck - * @param {Mixed} valueToBeAbove + * @param {unknown} valueToCheck + * @param {unknown} valueToBeAbove * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isAbove = function (val, abv, msg) { new Assertion(val, msg, assert.isAbove, true).to.be.above(abv); }; @@ -275,13 +263,12 @@ assert.isAbove = function (val, abv, msg) { * assert.isAtLeast(3, 3, '3 is greater or equal to 3'); * * @name isAtLeast - * @param {Mixed} valueToCheck - * @param {Mixed} valueToBeAtLeast + * @param {unknown} valueToCheck + * @param {unknown} valueToBeAtLeast * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isAtLeast = function (val, atlst, msg) { new Assertion(val, msg, assert.isAtLeast, true).to.be.least(atlst); }; @@ -294,13 +281,12 @@ assert.isAtLeast = function (val, atlst, msg) { * assert.isBelow(3, 6, '3 is strictly less than 6'); * * @name isBelow - * @param {Mixed} valueToCheck - * @param {Mixed} valueToBeBelow + * @param {unknown} valueToCheck + * @param {unknown} valueToBeBelow * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isBelow = function (val, blw, msg) { new Assertion(val, msg, assert.isBelow, true).to.be.below(blw); }; @@ -314,13 +300,12 @@ assert.isBelow = function (val, blw, msg) { * assert.isAtMost(4, 4, '4 is less than or equal to 4'); * * @name isAtMost - * @param {Mixed} valueToCheck - * @param {Mixed} valueToBeAtMost + * @param {unknown} valueToCheck + * @param {unknown} valueToBeAtMost * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isAtMost = function (val, atmst, msg) { new Assertion(val, msg, assert.isAtMost, true).to.be.most(atmst); }; @@ -334,12 +319,11 @@ assert.isAtMost = function (val, atmst, msg) { * assert.isTrue(teaServed, 'the tea has been served'); * * @name isTrue - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isTrue = function (val, msg) { new Assertion(val, msg, assert.isTrue, true).is['true']; }; @@ -353,12 +337,11 @@ assert.isTrue = function (val, msg) { * assert.isNotTrue(tea, 'great, time for tea!'); * * @name isNotTrue - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNotTrue = function (val, msg) { new Assertion(val, msg, assert.isNotTrue, true).to.not.equal(true); }; @@ -372,12 +355,11 @@ assert.isNotTrue = function (val, msg) { * assert.isFalse(teaServed, 'no tea yet? hmm...'); * * @name isFalse - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isFalse = function (val, msg) { new Assertion(val, msg, assert.isFalse, true).is['false']; }; @@ -391,12 +373,11 @@ assert.isFalse = function (val, msg) { * assert.isNotFalse(tea, 'great, time for tea!'); * * @name isNotFalse - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNotFalse = function (val, msg) { new Assertion(val, msg, assert.isNotFalse, true).to.not.equal(false); }; @@ -409,12 +390,11 @@ assert.isNotFalse = function (val, msg) { * assert.isNull(err, 'there was no error'); * * @name isNull - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNull = function (val, msg) { new Assertion(val, msg, assert.isNull, true).to.equal(null); }; @@ -428,12 +408,11 @@ assert.isNull = function (val, msg) { * assert.isNotNull(tea, 'great, time for tea!'); * * @name isNotNull - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNotNull = function (val, msg) { new Assertion(val, msg, assert.isNotNull, true).to.not.equal(null); }; @@ -446,12 +425,11 @@ assert.isNotNull = function (val, msg) { * assert.isNaN(NaN, 'NaN is NaN'); * * @name isNaN - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNaN = function (val, msg) { new Assertion(val, msg, assert.isNaN, true).to.be.NaN; }; @@ -464,12 +442,11 @@ assert.isNaN = function (val, msg) { * assert.isNotNaN(4, '4 is not NaN'); * * @name isNotNaN - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public - */ -assert.isNotNaN = function (val, msg) { + * @public + */assert.isNotNaN = function (val, msg) { new Assertion(val, msg, assert.isNotNaN, true).not.to.be.NaN; }; @@ -483,12 +460,11 @@ assert.isNotNaN = function (val, msg) { * assert.exists(foo, 'foo is neither `null` nor `undefined`'); * * @name exists - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.exists = function (val, msg) { new Assertion(val, msg, assert.exists, true).to.exist; }; @@ -505,12 +481,11 @@ assert.exists = function (val, msg) { * assert.notExists(baz, 'baz is either null or undefined'); * * @name notExists - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notExists = function (val, msg) { new Assertion(val, msg, assert.notExists, true).to.not.exist; }; @@ -524,12 +499,11 @@ assert.notExists = function (val, msg) { * assert.isUndefined(tea, 'no tea defined'); * * @name isUndefined - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isUndefined = function (val, msg) { new Assertion(val, msg, assert.isUndefined, true).to.equal(undefined); }; @@ -543,12 +517,11 @@ assert.isUndefined = function (val, msg) { * assert.isDefined(tea, 'tea has been defined'); * * @name isDefined - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isDefined = function (val, msg) { new Assertion(val, msg, assert.isDefined, true).to.not.equal(undefined); }; @@ -562,12 +535,11 @@ assert.isDefined = function (val, msg) { * assert.isCallable(serveTea, 'great, we can have tea now'); * * @name isCallable - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public - */ -assert.isCallable = function (val, msg) { + * @public + */assert.isCallable = function (val, msg) { new Assertion(val, msg, assert.isCallable, true).is.callable; } @@ -580,12 +552,11 @@ assert.isCallable = function (val, msg) { * assert.isNotCallable(serveTea, 'great, we have listed the steps'); * * @name isNotCallable - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public - */ -assert.isNotCallable = function (val, msg) { + * @public + */assert.isNotCallable = function (val, msg) { new Assertion(val, msg, assert.isNotCallable, true).is.not.callable; }; @@ -599,12 +570,11 @@ assert.isNotCallable = function (val, msg) { * assert.isObject(selection, 'tea selection is an object'); * * @name isObject - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isObject = function (val, msg) { new Assertion(val, msg, assert.isObject, true).to.be.a('object'); }; @@ -619,12 +589,11 @@ assert.isObject = function (val, msg) { * assert.isNotObject(null, 'null is not an object'); * * @name isNotObject - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNotObject = function (val, msg) { new Assertion(val, msg, assert.isNotObject, true).to.not.be.a('object'); }; @@ -638,12 +607,11 @@ assert.isNotObject = function (val, msg) { * assert.isArray(menu, 'what kind of tea do we want?'); * * @name isArray - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isArray = function (val, msg) { new Assertion(val, msg, assert.isArray, true).to.be.an('array'); }; @@ -657,12 +625,11 @@ assert.isArray = function (val, msg) { * assert.isNotArray(menu, 'what kind of tea do we want?'); * * @name isNotArray - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNotArray = function (val, msg) { new Assertion(val, msg, assert.isNotArray, true).to.not.be.an('array'); }; @@ -676,12 +643,11 @@ assert.isNotArray = function (val, msg) { * assert.isString(teaOrder, 'order placed'); * * @name isString - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isString = function (val, msg) { new Assertion(val, msg, assert.isString, true).to.be.a('string'); }; @@ -695,12 +661,11 @@ assert.isString = function (val, msg) { * assert.isNotString(teaOrder, 'order placed'); * * @name isNotString - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNotString = function (val, msg) { new Assertion(val, msg, assert.isNotString, true).to.not.be.a('string'); }; @@ -717,9 +682,8 @@ assert.isNotString = function (val, msg) { * @param {Number} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNumber = function (val, msg) { new Assertion(val, msg, assert.isNumber, true).to.be.a('number'); }; @@ -733,12 +697,11 @@ assert.isNumber = function (val, msg) { * assert.isNotNumber(cups, 'how many cups'); * * @name isNotNumber - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNotNumber = function (val, msg) { new Assertion(val, msg, assert.isNotNumber, true).to.not.be.a('number'); }; @@ -757,9 +720,8 @@ assert.isNotNumber = function (val, msg) { * @param {Number} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isFinite = function (val, msg) { new Assertion(val, msg, assert.isFinite, true).to.be.finite; }; @@ -776,12 +738,11 @@ assert.isFinite = function (val, msg) { * assert.isBoolean(teaServed, 'has tea been served'); * * @name isBoolean - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isBoolean = function (val, msg) { new Assertion(val, msg, assert.isBoolean, true).to.be.a('boolean'); }; @@ -798,12 +759,11 @@ assert.isBoolean = function (val, msg) { * assert.isNotBoolean(teaServed, 'has tea been served'); * * @name isNotBoolean - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.isNotBoolean = function (val, msg) { new Assertion(val, msg, assert.isNotBoolean, true).to.not.be.a('boolean'); }; @@ -822,13 +782,12 @@ assert.isNotBoolean = function (val, msg) { * assert.typeOf(undefined, 'undefined', 'we have an undefined'); * * @name typeOf - * @param {Mixed} value + * @param {unknown} value * @param {String} name * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.typeOf = function (val, type, msg) { new Assertion(val, msg, assert.typeOf, true).to.be.a(type); }; @@ -842,13 +801,12 @@ assert.typeOf = function (val, type, msg) { * assert.notTypeOf('tea', 'number', 'strings are not numbers'); * * @name notTypeOf - * @param {Mixed} value + * @param {unknown} value * @param {String} typeof name * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notTypeOf = function (val, type, msg) { new Assertion(val, msg, assert.notTypeOf, true).to.not.be.a(type); }; @@ -868,9 +826,8 @@ assert.notTypeOf = function (val, type, msg) { * @param {Constructor} constructor * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.instanceOf = function (val, type, msg) { new Assertion(val, msg, assert.instanceOf, true).to.be.instanceOf(type); }; @@ -890,9 +847,8 @@ assert.instanceOf = function (val, type, msg) { * @param {Constructor} constructor * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notInstanceOf = function (val, type, msg) { new Assertion(val, msg, assert.notInstanceOf, true) .to.not.be.instanceOf(type); @@ -923,12 +879,11 @@ assert.notInstanceOf = function (val, type, msg) { * * @name include * @param {Array|String} haystack - * @param {Mixed} needle + * @param {unknown} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.include = function (exp, inc, msg) { new Assertion(exp, msg, assert.include, true).include(inc); }; @@ -959,12 +914,11 @@ assert.include = function (exp, inc, msg) { * * @name notInclude * @param {Array|String} haystack - * @param {Mixed} needle + * @param {unknown} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notInclude = function (exp, inc, msg) { new Assertion(exp, msg, assert.notInclude, true).not.include(inc); }; @@ -984,12 +938,11 @@ assert.notInclude = function (exp, inc, msg) { * * @name deepInclude * @param {Array|String} haystack - * @param {Mixed} needle + * @param {unknown} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.deepInclude = function (exp, inc, msg) { new Assertion(exp, msg, assert.deepInclude, true).deep.include(inc); }; @@ -1009,12 +962,11 @@ assert.deepInclude = function (exp, inc, msg) { * * @name notDeepInclude * @param {Array|String} haystack - * @param {Mixed} needle + * @param {unknown} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notDeepInclude = function (exp, inc, msg) { new Assertion(exp, msg, assert.notDeepInclude, true).not.deep.include(inc); }; @@ -1037,9 +989,8 @@ assert.notDeepInclude = function (exp, inc, msg) { * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.nestedInclude = function (exp, inc, msg) { new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc); }; @@ -1062,9 +1013,8 @@ assert.nestedInclude = function (exp, inc, msg) { * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notNestedInclude = function (exp, inc, msg) { new Assertion(exp, msg, assert.notNestedInclude, true) .not.nested.include(inc); @@ -1088,9 +1038,8 @@ assert.notNestedInclude = function (exp, inc, msg) { * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.deepNestedInclude = function(exp, inc, msg) { new Assertion(exp, msg, assert.deepNestedInclude, true) .deep.nested.include(inc); @@ -1114,9 +1063,8 @@ assert.deepNestedInclude = function(exp, inc, msg) { * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notDeepNestedInclude = function(exp, inc, msg) { new Assertion(exp, msg, assert.notDeepNestedInclude, true) .not.deep.nested.include(inc); @@ -1136,9 +1084,8 @@ assert.notDeepNestedInclude = function(exp, inc, msg) { * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.ownInclude = function(exp, inc, msg) { new Assertion(exp, msg, assert.ownInclude, true).own.include(inc); }; @@ -1159,9 +1106,8 @@ assert.ownInclude = function(exp, inc, msg) { * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notOwnInclude = function(exp, inc, msg) { new Assertion(exp, msg, assert.notOwnInclude, true).not.own.include(inc); }; @@ -1180,9 +1126,8 @@ assert.notOwnInclude = function(exp, inc, msg) { * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.deepOwnInclude = function(exp, inc, msg) { new Assertion(exp, msg, assert.deepOwnInclude, true) .deep.own.include(inc); @@ -1202,9 +1147,8 @@ assert.deepOwnInclude = function(exp, inc, msg) { * @param {Object} needle * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notDeepOwnInclude = function(exp, inc, msg) { new Assertion(exp, msg, assert.notDeepOwnInclude, true) .not.deep.own.include(inc); @@ -1218,13 +1162,12 @@ assert.notDeepOwnInclude = function(exp, inc, msg) { * assert.match('foobar', /^foo/, 'regexp matches'); * * @name match - * @param {Mixed} value + * @param {unknown} value * @param {RegExp} regexp * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.match = function (exp, re, msg) { new Assertion(exp, msg, assert.match, true).to.match(re); }; @@ -1237,13 +1180,12 @@ assert.match = function (exp, re, msg) { * assert.notMatch('foobar', /^foo/, 'regexp does not match'); * * @name notMatch - * @param {Mixed} value + * @param {unknown} value * @param {RegExp} regexp * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notMatch = function (exp, re, msg) { new Assertion(exp, msg, assert.notMatch, true).to.not.match(re); }; @@ -1262,9 +1204,8 @@ assert.notMatch = function (exp, re, msg) { * @param {String} property * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.property = function (obj, prop, msg) { new Assertion(obj, msg, assert.property, true).to.have.property(prop); }; @@ -1282,9 +1223,8 @@ assert.property = function (obj, prop, msg) { * @param {String} property * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notProperty = function (obj, prop, msg) { new Assertion(obj, msg, assert.notProperty, true) .to.not.have.property(prop); @@ -1302,12 +1242,11 @@ assert.notProperty = function (obj, prop, msg) { * @name propertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.propertyVal = function (obj, prop, val, msg) { new Assertion(obj, msg, assert.propertyVal, true) .to.have.property(prop, val); @@ -1326,12 +1265,11 @@ assert.propertyVal = function (obj, prop, val, msg) { * @name notPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notPropertyVal = function (obj, prop, val, msg) { new Assertion(obj, msg, assert.notPropertyVal, true) .to.not.have.property(prop, val); @@ -1348,12 +1286,11 @@ assert.notPropertyVal = function (obj, prop, val, msg) { * @name deepPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.deepPropertyVal = function (obj, prop, val, msg) { new Assertion(obj, msg, assert.deepPropertyVal, true) .to.have.deep.property(prop, val); @@ -1372,12 +1309,11 @@ assert.deepPropertyVal = function (obj, prop, val, msg) { * @name notDeepPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notDeepPropertyVal = function (obj, prop, val, msg) { new Assertion(obj, msg, assert.notDeepPropertyVal, true) .to.not.have.deep.property(prop, val); @@ -1395,9 +1331,8 @@ assert.notDeepPropertyVal = function (obj, prop, val, msg) { * @param {Object} object * @param {String} property * @param {String} message - * @api public + * @public */ - assert.ownProperty = function (obj, prop, msg) { new Assertion(obj, msg, assert.ownProperty, true) .to.have.own.property(prop); @@ -1416,9 +1351,8 @@ assert.ownProperty = function (obj, prop, msg) { * @param {Object} object * @param {String} property * @param {String} message - * @api public + * @public */ - assert.notOwnProperty = function (obj, prop, msg) { new Assertion(obj, msg, assert.notOwnProperty, true) .to.not.have.own.property(prop); @@ -1436,11 +1370,10 @@ assert.notOwnProperty = function (obj, prop, msg) { * @name ownPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message - * @api public + * @public */ - assert.ownPropertyVal = function (obj, prop, value, msg) { new Assertion(obj, msg, assert.ownPropertyVal, true) .to.have.own.property(prop, value); @@ -1459,11 +1392,10 @@ assert.ownPropertyVal = function (obj, prop, value, msg) { * @name notOwnPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message - * @api public + * @public */ - assert.notOwnPropertyVal = function (obj, prop, value, msg) { new Assertion(obj, msg, assert.notOwnPropertyVal, true) .to.not.have.own.property(prop, value); @@ -1481,11 +1413,10 @@ assert.notOwnPropertyVal = function (obj, prop, value, msg) { * @name deepOwnPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message - * @api public + * @public */ - assert.deepOwnPropertyVal = function (obj, prop, value, msg) { new Assertion(obj, msg, assert.deepOwnPropertyVal, true) .to.have.deep.own.property(prop, value); @@ -1506,11 +1437,10 @@ assert.deepOwnPropertyVal = function (obj, prop, value, msg) { * @name notDeepOwnPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message - * @api public + * @public */ - assert.notDeepOwnPropertyVal = function (obj, prop, value, msg) { new Assertion(obj, msg, assert.notDeepOwnPropertyVal, true) .to.not.have.deep.own.property(prop, value); @@ -1530,9 +1460,8 @@ assert.notDeepOwnPropertyVal = function (obj, prop, value, msg) { * @param {String} property * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.nestedProperty = function (obj, prop, msg) { new Assertion(obj, msg, assert.nestedProperty, true) .to.have.nested.property(prop); @@ -1552,9 +1481,8 @@ assert.nestedProperty = function (obj, prop, msg) { * @param {String} property * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notNestedProperty = function (obj, prop, msg) { new Assertion(obj, msg, assert.notNestedProperty, true) .to.not.have.nested.property(prop); @@ -1572,12 +1500,11 @@ assert.notNestedProperty = function (obj, prop, msg) { * @name nestedPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.nestedPropertyVal = function (obj, prop, val, msg) { new Assertion(obj, msg, assert.nestedPropertyVal, true) .to.have.nested.property(prop, val); @@ -1596,12 +1523,11 @@ assert.nestedPropertyVal = function (obj, prop, val, msg) { * @name notNestedPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notNestedPropertyVal = function (obj, prop, val, msg) { new Assertion(obj, msg, assert.notNestedPropertyVal, true) .to.not.have.nested.property(prop, val); @@ -1619,12 +1545,11 @@ assert.notNestedPropertyVal = function (obj, prop, val, msg) { * @name deepNestedPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.deepNestedPropertyVal = function (obj, prop, val, msg) { new Assertion(obj, msg, assert.deepNestedPropertyVal, true) .to.have.deep.nested.property(prop, val); @@ -1644,12 +1569,11 @@ assert.deepNestedPropertyVal = function (obj, prop, val, msg) { * @name notDeepNestedPropertyVal * @param {Object} object * @param {String} property - * @param {Mixed} value + * @param {unknown} value * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notDeepNestedPropertyVal = function (obj, prop, val, msg) { new Assertion(obj, msg, assert.notDeepNestedPropertyVal, true) .to.not.have.deep.nested.property(prop, val); @@ -1666,13 +1590,12 @@ assert.notDeepNestedPropertyVal = function (obj, prop, val, msg) { * assert.lengthOf(new Map([['a',1],['b',2],['c',3]]), 3, 'map has size of 3'); * * @name lengthOf - * @param {Mixed} object + * @param {unknown} object * @param {Number} length * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.lengthOf = function (exp, len, msg) { new Assertion(exp, msg, assert.lengthOf, true).to.have.lengthOf(len); }; @@ -1690,13 +1613,12 @@ assert.lengthOf = function (exp, len, msg) { * assert.hasAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); * * @name hasAnyKeys - * @param {Mixed} object + * @param {unknown} object * @param {Array|Object} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.hasAnyKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.hasAnyKeys, true).to.have.any.keys(keys); } @@ -1714,13 +1636,12 @@ assert.hasAnyKeys = function (obj, keys, msg) { * assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']); * * @name hasAllKeys - * @param {Mixed} object + * @param {unknown} object * @param {String[]} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.hasAllKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.hasAllKeys, true).to.have.all.keys(keys); } @@ -1742,13 +1663,12 @@ assert.hasAllKeys = function (obj, keys, msg) { * assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']); * * @name containsAllKeys - * @param {Mixed} object + * @param {unknown} object * @param {String[]} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.containsAllKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.containsAllKeys, true) .to.contain.all.keys(keys); @@ -1767,13 +1687,12 @@ assert.containsAllKeys = function (obj, keys, msg) { * assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']); * * @name doesNotHaveAnyKeys - * @param {Mixed} object + * @param {unknown} object * @param {String[]} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.doesNotHaveAnyKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.doesNotHaveAnyKeys, true) .to.not.have.any.keys(keys); @@ -1792,13 +1711,12 @@ assert.doesNotHaveAnyKeys = function (obj, keys, msg) { * assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']); * * @name doesNotHaveAllKeys - * @param {Mixed} object + * @param {unknown} object * @param {String[]} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.doesNotHaveAllKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.doesNotHaveAllKeys, true) .to.not.have.all.keys(keys); @@ -1821,13 +1739,12 @@ assert.doesNotHaveAllKeys = function (obj, keys, msg) { * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); * * @name hasAnyDeepKeys - * @param {Mixed} object + * @param {unknown} object * @param {Array|Object} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.hasAnyDeepKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.hasAnyDeepKeys, true) .to.have.any.deep.keys(keys); @@ -1848,13 +1765,12 @@ assert.hasAnyDeepKeys = function (obj, keys, msg) { * assert.hasAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); * * @name hasAllDeepKeys - * @param {Mixed} object + * @param {unknown} object * @param {Array|Object} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.hasAllDeepKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.hasAllDeepKeys, true) .to.have.all.deep.keys(keys); @@ -1875,13 +1791,12 @@ assert.hasAllDeepKeys = function (obj, keys, msg) { * assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); * * @name containsAllDeepKeys - * @param {Mixed} object + * @param {unknown} object * @param {Array|Object} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.containsAllDeepKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.containsAllDeepKeys, true) .to.contain.all.deep.keys(keys); @@ -1902,13 +1817,12 @@ assert.containsAllDeepKeys = function (obj, keys, msg) { * assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); * * @name doesNotHaveAnyDeepKeys - * @param {Mixed} object + * @param {unknown} object * @param {Array|Object} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.doesNotHaveAnyDeepKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.doesNotHaveAnyDeepKeys, true) .to.not.have.any.deep.keys(keys); @@ -1929,13 +1843,12 @@ assert.doesNotHaveAnyDeepKeys = function (obj, keys, msg) { * assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {fifty: 'fifty'}]); * * @name doesNotHaveAllDeepKeys - * @param {Mixed} object + * @param {unknown} object * @param {Array|Object} keys * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.doesNotHaveAllDeepKeys = function (obj, keys, msg) { new Assertion(obj, msg, assert.doesNotHaveAllDeepKeys, true) .to.not.have.all.deep.keys(keys); @@ -1969,9 +1882,8 @@ assert.doesNotHaveAllDeepKeys = function (obj, keys, msg) { * @param {String} message * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types * @namespace Assert - * @api public + * @public */ - assert.throws = function (fn, errorLike, errMsgMatcher, msg) { if ('string' === typeof errorLike || errorLike instanceof RegExp) { errMsgMatcher = errorLike; @@ -2009,9 +1921,8 @@ assert.throws = function (fn, errorLike, errMsgMatcher, msg) { * @param {String} message * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types * @namespace Assert - * @api public + * @public */ - assert.doesNotThrow = function (fn, errorLike, errMsgMatcher, msg) { if ('string' === typeof errorLike || errorLike instanceof RegExp) { errMsgMatcher = errorLike; @@ -2031,14 +1942,13 @@ assert.doesNotThrow = function (fn, errorLike, errMsgMatcher, msg) { * assert.operator(1, '>', 2, 'this will fail'); * * @name operator - * @param {Mixed} val1 + * @param {unknown} val1 * @param {String} operator - * @param {Mixed} val2 + * @param {unknown} val2 * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.operator = function (val, operator, val2, msg) { var ok; switch(operator) { @@ -2094,9 +2004,8 @@ assert.operator = function (val, operator, val2, msg) { * @param {Number} delta * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.closeTo = function (act, exp, delta, msg) { new Assertion(act, msg, assert.closeTo, true).to.be.closeTo(exp, delta); }; @@ -2114,9 +2023,8 @@ assert.closeTo = function (act, exp, delta, msg) { * @param {Number} delta * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.approximately = function (act, exp, delta, msg) { new Assertion(act, msg, assert.approximately, true) .to.be.approximately(exp, delta); @@ -2135,9 +2043,8 @@ assert.approximately = function (act, exp, delta, msg) { * @param {Array} set2 * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.sameMembers = function (set1, set2, msg) { new Assertion(set1, msg, assert.sameMembers, true) .to.have.same.members(set2); @@ -2156,9 +2063,8 @@ assert.sameMembers = function (set1, set2, msg) { * @param {Array} set2 * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notSameMembers = function (set1, set2, msg) { new Assertion(set1, msg, assert.notSameMembers, true) .to.not.have.same.members(set2); @@ -2177,9 +2083,8 @@ assert.notSameMembers = function (set1, set2, msg) { * @param {Array} set2 * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.sameDeepMembers = function (set1, set2, msg) { new Assertion(set1, msg, assert.sameDeepMembers, true) .to.have.same.deep.members(set2); @@ -2198,9 +2103,8 @@ assert.sameDeepMembers = function (set1, set2, msg) { * @param {Array} set2 * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notSameDeepMembers = function (set1, set2, msg) { new Assertion(set1, msg, assert.notSameDeepMembers, true) .to.not.have.same.deep.members(set2); @@ -2219,9 +2123,8 @@ assert.notSameDeepMembers = function (set1, set2, msg) { * @param {Array} set2 * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.sameOrderedMembers = function (set1, set2, msg) { new Assertion(set1, msg, assert.sameOrderedMembers, true) .to.have.same.ordered.members(set2); @@ -2240,9 +2143,8 @@ assert.sameOrderedMembers = function (set1, set2, msg) { * @param {Array} set2 * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notSameOrderedMembers = function (set1, set2, msg) { new Assertion(set1, msg, assert.notSameOrderedMembers, true) .to.not.have.same.ordered.members(set2); @@ -2261,9 +2163,8 @@ assert.notSameOrderedMembers = function (set1, set2, msg) { * @param {Array} set2 * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.sameDeepOrderedMembers = function (set1, set2, msg) { new Assertion(set1, msg, assert.sameDeepOrderedMembers, true) .to.have.same.deep.ordered.members(set2); @@ -2283,9 +2184,8 @@ assert.sameDeepOrderedMembers = function (set1, set2, msg) { * @param {Array} set2 * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notSameDeepOrderedMembers = function (set1, set2, msg) { new Assertion(set1, msg, assert.notSameDeepOrderedMembers, true) .to.not.have.same.deep.ordered.members(set2); @@ -2304,9 +2204,8 @@ assert.notSameDeepOrderedMembers = function (set1, set2, msg) { * @param {Array} subset * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.includeMembers = function (superset, subset, msg) { new Assertion(superset, msg, assert.includeMembers, true) .to.include.members(subset); @@ -2325,9 +2224,8 @@ assert.includeMembers = function (superset, subset, msg) { * @param {Array} subset * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notIncludeMembers = function (superset, subset, msg) { new Assertion(superset, msg, assert.notIncludeMembers, true) .to.not.include.members(subset); @@ -2346,9 +2244,8 @@ assert.notIncludeMembers = function (superset, subset, msg) { * @param {Array} subset * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.includeDeepMembers = function (superset, subset, msg) { new Assertion(superset, msg, assert.includeDeepMembers, true) .to.include.deep.members(subset); @@ -2367,9 +2264,8 @@ assert.includeDeepMembers = function (superset, subset, msg) { * @param {Array} subset * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notIncludeDeepMembers = function (superset, subset, msg) { new Assertion(superset, msg, assert.notIncludeDeepMembers, true) .to.not.include.deep.members(subset); @@ -2389,9 +2285,8 @@ assert.notIncludeDeepMembers = function (superset, subset, msg) { * @param {Array} subset * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.includeOrderedMembers = function (superset, subset, msg) { new Assertion(superset, msg, assert.includeOrderedMembers, true) .to.include.ordered.members(subset); @@ -2412,9 +2307,8 @@ assert.includeOrderedMembers = function (superset, subset, msg) { * @param {Array} subset * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notIncludeOrderedMembers = function (superset, subset, msg) { new Assertion(superset, msg, assert.notIncludeOrderedMembers, true) .to.not.include.ordered.members(subset); @@ -2434,9 +2328,8 @@ assert.notIncludeOrderedMembers = function (superset, subset, msg) { * @param {Array} subset * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.includeDeepOrderedMembers = function (superset, subset, msg) { new Assertion(superset, msg, assert.includeDeepOrderedMembers, true) .to.include.deep.ordered.members(subset); @@ -2458,9 +2351,8 @@ assert.includeDeepOrderedMembers = function (superset, subset, msg) { * @param {Array} subset * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.notIncludeDeepOrderedMembers = function (superset, subset, msg) { new Assertion(superset, msg, assert.notIncludeDeepOrderedMembers, true) .to.not.include.deep.ordered.members(subset); @@ -2478,9 +2370,8 @@ assert.notIncludeDeepOrderedMembers = function (superset, subset, msg) { * @param {Array<*>} list * @param {String} message * @namespace Assert - * @api public + * @public */ - assert.oneOf = function (inList, list, msg) { new Assertion(inList, msg, assert.oneOf, true).to.be.oneOf(list); } @@ -2500,9 +2391,8 @@ assert.oneOf = function (inList, list, msg) { * @param {String} property name _optional_ * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.changes = function (fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === 'function') { msg = prop; @@ -2528,9 +2418,8 @@ assert.changes = function (fn, obj, prop, msg) { * @param {Number} change amount (delta) * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.changesBy = function (fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === 'function') { var tmpMsg = delta; @@ -2560,9 +2449,8 @@ assert.changesBy = function (fn, obj, prop, delta, msg) { * @param {String} property name _optional_ * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.doesNotChange = function (fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === 'function') { msg = prop; @@ -2589,9 +2477,8 @@ assert.doesNotChange = function (fn, obj, prop, msg) { * @param {Number} change amount (delta) * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.changesButNotBy = function (fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === 'function') { var tmpMsg = delta; @@ -2621,9 +2508,8 @@ assert.changesButNotBy = function (fn, obj, prop, delta, msg) { * @param {String} property name _optional_ * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.increases = function (fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === 'function') { msg = prop; @@ -2650,9 +2536,8 @@ assert.increases = function (fn, obj, prop, msg) { * @param {Number} change amount (delta) * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.increasesBy = function (fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === 'function') { var tmpMsg = delta; @@ -2682,9 +2567,8 @@ assert.increasesBy = function (fn, obj, prop, delta, msg) { * @param {String} property name _optional_ * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.doesNotIncrease = function (fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === 'function') { msg = prop; @@ -2711,9 +2595,8 @@ assert.doesNotIncrease = function (fn, obj, prop, msg) { * @param {Number} change amount (delta) * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.increasesButNotBy = function (fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === 'function') { var tmpMsg = delta; @@ -2743,9 +2626,8 @@ assert.increasesButNotBy = function (fn, obj, prop, delta, msg) { * @param {String} property name _optional_ * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.decreases = function (fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === 'function') { msg = prop; @@ -2772,9 +2654,8 @@ assert.decreases = function (fn, obj, prop, msg) { * @param {Number} change amount (delta) * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.decreasesBy = function (fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === 'function') { var tmpMsg = delta; @@ -2804,9 +2685,8 @@ assert.decreasesBy = function (fn, obj, prop, delta, msg) { * @param {String} property name _optional_ * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.doesNotDecrease = function (fn, obj, prop, msg) { if (arguments.length === 3 && typeof obj === 'function') { msg = prop; @@ -2833,9 +2713,8 @@ assert.doesNotDecrease = function (fn, obj, prop, msg) { * @param {Number} change amount (delta) * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.doesNotDecreaseBy = function (fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === 'function') { var tmpMsg = delta; @@ -2866,9 +2745,8 @@ assert.doesNotDecreaseBy = function (fn, obj, prop, delta, msg) { * @param {Number} change amount (delta) * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.decreasesButNotBy = function (fn, obj, prop, delta, msg) { if (arguments.length === 4 && typeof obj === 'function') { var tmpMsg = delta; @@ -2896,9 +2774,8 @@ assert.decreasesButNotBy = function (fn, obj, prop, delta, msg) { * @name ifError * @param {Object} object * @namespace Assert - * @api public + * @public */ - assert.ifError = function (val) { if (val) { throw(val); @@ -2917,9 +2794,8 @@ assert.ifError = function (val) { * @param {Object} object * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.isExtensible = function (obj, msg) { new Assertion(obj, msg, assert.isExtensible, true).to.be.extensible; }; @@ -2942,9 +2818,8 @@ assert.isExtensible = function (obj, msg) { * @param {Object} object * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.isNotExtensible = function (obj, msg) { new Assertion(obj, msg, assert.isNotExtensible, true).to.not.be.extensible; }; @@ -2966,9 +2841,8 @@ assert.isNotExtensible = function (obj, msg) { * @param {Object} object * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.isSealed = function (obj, msg) { new Assertion(obj, msg, assert.isSealed, true).to.be.sealed; }; @@ -2985,9 +2859,8 @@ assert.isSealed = function (obj, msg) { * @param {Object} object * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.isNotSealed = function (obj, msg) { new Assertion(obj, msg, assert.isNotSealed, true).to.not.be.sealed; }; @@ -3006,9 +2879,8 @@ assert.isNotSealed = function (obj, msg) { * @param {Object} object * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.isFrozen = function (obj, msg) { new Assertion(obj, msg, assert.isFrozen, true).to.be.frozen; }; @@ -3025,9 +2897,8 @@ assert.isFrozen = function (obj, msg) { * @param {Object} object * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.isNotFrozen = function (obj, msg) { new Assertion(obj, msg, assert.isNotFrozen, true).to.not.be.frozen; }; @@ -3051,9 +2922,8 @@ assert.isNotFrozen = function (obj, msg) { * @param {Object|Array|String|Map|Set} target * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.isEmpty = function(val, msg) { new Assertion(val, msg, assert.isEmpty, true).to.be.empty; }; @@ -3077,9 +2947,8 @@ assert.isEmpty = function(val, msg) { * @param {Object|Array|String|Map|Set} target * @param {String} message _optional_ * @namespace Assert - * @api public + * @public */ - assert.isNotEmpty = function(val, msg) { new Assertion(val, msg, assert.isNotEmpty, true).to.not.be.empty; }; @@ -3087,7 +2956,6 @@ assert.isNotEmpty = function(val, msg) { /*! * Aliases. */ - (function alias(name, as){ assert[as] = assert[name]; return alias; diff --git a/lib/chai/interface/expect.js b/lib/chai/interface/expect.js index 70a9416c..286044a1 100644 --- a/lib/chai/interface/expect.js +++ b/lib/chai/interface/expect.js @@ -13,6 +13,7 @@ function expect(val, message) { } export {expect}; + /** * ### .fail([message]) * ### .fail(actual, expected, [message], [operator]) @@ -27,14 +28,13 @@ export {expect}; * expect.fail(1, 2, undefined, ">"); * * @name fail - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @param {String} operator - * @namespace BDD - * @api public + * @namespace expect + * @public */ - expect.fail = function (actual, expected, message, operator) { if (arguments.length < 2) { message = actual; diff --git a/lib/chai/interface/should.js b/lib/chai/interface/should.js index 8269a58b..3a2c235d 100644 --- a/lib/chai/interface/should.js +++ b/lib/chai/interface/should.js @@ -57,14 +57,13 @@ function loadShould () { * * * @name fail - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @param {String} operator * @namespace BDD - * @api public + * @public */ - should.fail = function (actual, expected, message, operator) { if (arguments.length < 2) { message = actual; @@ -87,13 +86,12 @@ function loadShould () { * should.equal(3, '3', '== coerces values to strings'); * * @name equal - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @namespace Should - * @api public + * @public */ - should.equal = function (val1, val2, msg) { new Assertion(val1, msg).to.equal(val2); }; @@ -119,9 +117,8 @@ function loadShould () { * @param {String} message * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types * @namespace Should - * @api public + * @public */ - should.Throw = function (fn, errt, errs, msg) { new Assertion(fn, msg).to.Throw(errt, errs); }; @@ -137,9 +134,8 @@ function loadShould () { * * @name exist * @namespace Should - * @api public + * @public */ - should.exist = function (val, msg) { new Assertion(val, msg).to.exist; } @@ -155,13 +151,12 @@ function loadShould () { * should.not.equal(3, 4, 'these numbers are not equal'); * * @name not.equal - * @param {Mixed} actual - * @param {Mixed} expected + * @param {unknown} actual + * @param {unknown} expected * @param {String} message * @namespace Should - * @api public + * @public */ - should.not.equal = function (val1, val2, msg) { new Assertion(val1, msg).to.not.equal(val2); }; @@ -183,9 +178,8 @@ function loadShould () { * @param {String} message * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types * @namespace Should - * @api public + * @public */ - should.not.Throw = function (fn, errt, errs, msg) { new Assertion(fn, msg).to.not.Throw(errt, errs); }; @@ -201,9 +195,8 @@ function loadShould () { * * @name not.exist * @namespace Should - * @api public + * @public */ - should.not.exist = function (val, msg) { new Assertion(val, msg).to.not.exist; }