From 367f671841c279dba87864aac98c8fa1d046131f Mon Sep 17 00:00:00 2001 From: Bryan Ingle Date: Thu, 27 Jan 2022 11:32:02 -0700 Subject: [PATCH] Tweak JSDoc for specification classes --- specifications/Between.js | 4 ++-- specifications/Changes.js | 7 ++++--- specifications/Contains.js | 2 +- specifications/Nan.js | 4 +--- specifications/Numeric.js | 2 +- test/SpecRunner.js | 26 ++++++++++++-------------- 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/specifications/Between.js b/specifications/Between.js index 9826c812..9daefbba 100644 --- a/specifications/Between.js +++ b/specifications/Between.js @@ -7,11 +7,11 @@ module.exports = (() => { /** * A {@link Specification} that passes when the value of the data item - * is between the values passed to the constructor + * is between the values passed to the constructor. * * @public * @extends {Specification} - * @param {Number} value + * @param {Number[]} values */ class Between extends Specification { constructor(values) { diff --git a/specifications/Changes.js b/specifications/Changes.js index aa21d86c..7d1df33f 100644 --- a/specifications/Changes.js +++ b/specifications/Changes.js @@ -7,9 +7,10 @@ module.exports = (() => { /** * A stateful {@link Specification} that passes when the value of the data item - * is a changes. This specification will never pass on the first data - * item tested. Instead, the first data item sets the "previous" value - * used to compare the next data item to. + * a changes. This specification will never pass on the first data item tested. + * Each invocation compares the previous data item to the current data item, + * which means the specification can only pass on the second (or subsequent) + * invocation. * * @public * @extends {Specification} diff --git a/specifications/Contains.js b/specifications/Contains.js index 3ebd02e5..4cd3fe36 100644 --- a/specifications/Contains.js +++ b/specifications/Contains.js @@ -5,7 +5,7 @@ module.exports = (() => { /** * A {@link Specification} that passes when an item (passed to the - * constructor) is contained within an array. + * constructor) is contained within an array passed as the data item. * * @public * @extends {Specification} diff --git a/specifications/Nan.js b/specifications/Nan.js index 465ca0a4..4e850c74 100644 --- a/specifications/Nan.js +++ b/specifications/Nan.js @@ -6,12 +6,10 @@ module.exports = (() => { 'use strict'; /** - * A {@link Specification} that passes when the value of the data item - * is NaN. + * A {@link Specification} that passes when a data item evaluates to NaN. * * @public * @extends {Specification} - * @param {*} value */ class Nan extends Specification { constructor() { diff --git a/specifications/Numeric.js b/specifications/Numeric.js index 840a6270..5133016a 100644 --- a/specifications/Numeric.js +++ b/specifications/Numeric.js @@ -6,7 +6,7 @@ module.exports = (() => { 'use strict'; /** - * A {@link Specification} that passes when the value of the data item + * A {@link Specification} that passes when the type of the data item * is a number. * * @public diff --git a/test/SpecRunner.js b/test/SpecRunner.js index acb89551..6080690d 100644 --- a/test/SpecRunner.js +++ b/test/SpecRunner.js @@ -16224,11 +16224,11 @@ module.exports = (() => { 'use strict'; /** * A {@link Specification} that passes when the value of the data item - * is between the values passed to the constructor + * is between the values passed to the constructor. * * @public * @extends {Specification} - * @param {Number} value + * @param {Number[]} values */ class Between extends Specification { @@ -16261,16 +16261,16 @@ module.exports = (() => { 'use strict'; /** * A stateful {@link Specification} that passes when the value of the data item - * is a changes. This specification will never pass on the first data - * item tested. Instead, the first data item sets the "previous" value - * used to compare the next data item to. + * a changes. This specification will never pass on the first data item tested. + * Each invocation compares the previous data item to the current data item, + * which means the specification can only pass on the second (or subsequent) + * invocation. * * @public * @extends {Specification} - * @param {*} value */ - class ChangesSpecification extends Specification { + class Changes extends Specification { constructor() { super(); this._previous = null; @@ -16289,12 +16289,12 @@ module.exports = (() => { } toString() { - return '[ChangesSpecification]'; + return '[Changes]'; } } - return ChangesSpecification; + return Changes; })(); },{"./../lang/is":36,"./Specification":74}],65:[function(require,module,exports){ @@ -16340,7 +16340,7 @@ module.exports = (() => { 'use strict'; /** * A {@link Specification} that passes when an item (passed to the - * constructor) is contained within an array. + * constructor) is contained within an array passed as the data item. * * @public * @extends {Specification} @@ -16437,12 +16437,10 @@ const Specification = require('./Specification'); module.exports = (() => { 'use strict'; /** - * A {@link Specification} that passes when the value of the data item - * is NaN. + * A {@link Specification} that passes when a data item evaluates to NaN. * * @public * @extends {Specification} - * @param {*} value */ class Nan extends Specification { @@ -16480,7 +16478,7 @@ const Specification = require('./Specification'); module.exports = (() => { 'use strict'; /** - * A {@link Specification} that passes when the value of the data item + * A {@link Specification} that passes when the type of the data item * is a number. * * @public