Skip to content

Commit 9109203

Browse files
committed
chore: reintroduce jsdoc changes from main
1 parent 3639b0d commit 9109203

File tree

5 files changed

+31
-27
lines changed

5 files changed

+31
-27
lines changed

src/chai/assertion.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ const getDefaultValue = <T>(assertion: Assertion<T>): Assertion<T> => {
6565
*
6666
* - `eql`: This flag contains the deepEqual function to be used by the assertion.
6767
*
68-
* @param {Mixed} obj target of the assertion
69-
* @param {String} msg (optional) custom error message
68+
* @param {unknown} obj target of the assertion
69+
* @param {string} msg (optional) custom error message
7070
* @param {Function} ssfi (optional) starting point for removing stack frames
71-
* @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked
72-
* @api private
71+
* @param {boolean} lockSsfi (optional) whether or not the ssfi flag is locked
72+
* @private
7373
*/
7474
export class Assertion<T, TFlags extends AssertionFlags<T> = AssertionFlags<T>> {
7575
declare public __flags: TFlags;
@@ -174,13 +174,13 @@ export class Assertion<T, TFlags extends AssertionFlags<T> = AssertionFlags<T>>
174174
* Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
175175
*
176176
* @name assert
177-
* @param {Philosophical} expression to be tested
178-
* @param {String|Function} message or function that returns message to display if expression fails
179-
* @param {String|Function} negatedMessage or function that returns negatedMessage to display if negated expression fails
180-
* @param {Mixed} expected value (remember to check for negation)
181-
* @param {Mixed} actual (optional) will default to `this.obj`
182-
* @param {Boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails
183-
* @api private
177+
* @param {unknown} _expr to be tested
178+
* @param {string | Function} msg or function that returns message to display if expression fails
179+
* @param {string | Function} _negateMsg or function that returns negatedMessage to display if negated expression fails
180+
* @param {unknown} expected value (remember to check for negation)
181+
* @param {unknown} _actual (optional) will default to `this.obj`
182+
* @param {boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails
183+
* @private
184184
*/
185185
public assert(
186186
_expr: unknown,
@@ -222,7 +222,7 @@ export class Assertion<T, TFlags extends AssertionFlags<T> = AssertionFlags<T>>
222222
*
223223
* Quick reference to stored `actual` value for plugin developers.
224224
*
225-
* @api private
225+
* @private
226226
*/
227227
public get _obj(): unknown {
228228
return util.flag(this, 'object');

src/chai/interface/expect.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@ export {expect};
3434
* expect.fail(1, 2, undefined, ">");
3535
*
3636
* @name fail
37-
* @param {Mixed} actual
38-
* @param {Mixed} expected
39-
* @param {String} message
40-
* @param {String} operator
41-
* @namespace BDD
42-
* @api public
37+
* @param {unknown} actual
38+
* @param {unknown} expected
39+
* @param {string} message
40+
* @param {string} operator
41+
* @namespace expect
42+
* @public
4343
*/
44-
4544
function expectFail(
4645
message?: string
4746
): void;

src/chai/interface/should.ts

+8
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ declare global {
3232

3333
/**
3434
* Loads the `should` interface
35+
*
36+
* @returns {ShouldInterface}
3537
*/
3638
function loadShould (): ShouldInterface {
3739
// explicitly define this method as function as to have it's name to include as `ssfi`
40+
/**
41+
* @returns {Assertion}
42+
*/
3843
function shouldGetter(this: unknown) {
3944
if (this instanceof String
4045
|| this instanceof Number
@@ -45,6 +50,9 @@ function loadShould (): ShouldInterface {
4550
}
4651
return Assertion.create(this, null, shouldGetter);
4752
}
53+
/**
54+
* @param {unknown} value
55+
*/
4856
function shouldSetter(this: unknown, value: unknown) {
4957
// See https://github.com/chaijs/chai/issues/86: this makes
5058
// `whatever.should = someValue` actually set `someValue`, which is

src/chai/utils/addChainableMethod.ts

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
* MIT Licensed
55
*/
66

7-
/*!
8-
* Module dependencies
9-
*/
10-
117
import {addLengthGuard} from './addLengthGuard.js';
128
import {flag} from './flag.js';
139
import {proxify} from './proxify.js';

src/chai/utils/flag.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
* utils.flag(this, 'foo', 'bar'); // setter
1616
* utils.flag(this, 'foo'); // getter, returns `bar`
1717
*
18-
* @param {Object} object constructed Assertion
19-
* @param {String} key
20-
* @param {Mixed} value (optional)
18+
* @param {object} obj constructed Assertion
19+
* @param {string} key
20+
* @param {mixed} value (optional)
21+
* @returns {unknown | undefined}
2122
* @namespace Utils
2223
* @name flag
23-
* @api private
24+
* @private
2425
*/
2526

2627
function flag<

0 commit comments

Comments
 (0)