Skip to content

Commit

Permalink
update jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Jun 10, 2020
1 parent 4e0eb15 commit 8e5add2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
11 changes: 5 additions & 6 deletions packages/vest/src/core/Context/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import singleton from '../../lib/singleton';

/**
* Creates a new context object, and assigns it as a static property on Vest's singleton.
* @param {Object} parent Parent context.
* @returns {Context} either an existing or a new context object.
*/

class Context {
/**
* Clears stored instance from constructor function.
Expand All @@ -21,6 +15,11 @@ class Context {
}
}

/**
* Creates a new context object, and assigns it as a static property on Vest's singleton.
* @param {Object} ctxRef Context data reference.
* @returns {Context} either an existing or a new context object.
*/
constructor(ctxRef) {
const ctx = singleton.useContext();
Object.assign(this, ctxRef);
Expand Down
6 changes: 6 additions & 0 deletions packages/vest/src/core/produce/genTestsSummary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import {
TEST_COUNT,
} from '../../test/lib/VestTest/constants';

/**
*
* @param {Object} stateKey The container for the test result data
* @param {VestTest} testObject
* @returns {Object} Test result summary
*/
const genTestObject = (stateKey, testObject) => {
const { fieldName, isWarning, failed, statement } = testObject;

Expand Down
2 changes: 1 addition & 1 deletion packages/vest/src/core/produce/get/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import collectFailureMessages from '../collectFailureMessages';

/**
* @param {string} suiteId
* @param {Object} state
* @param {'errors'|'warnings'} severityKey lookup severity
* @param {string} [fieldName]
* @returns suite or field's errors or warnings.
Expand Down
5 changes: 3 additions & 2 deletions packages/vest/src/core/produce/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import hasByGroup from './hasByGroup';

/**
* Registers done callbacks.
* @param {string} suiteId
* @param {Object} state
* @param {string} [fieldName]
* @param {Function} doneCallback
* @register {Object} Vest output object.
Expand Down Expand Up @@ -64,8 +64,9 @@ const extract = ({ groups, tests, name }) => ({
});

/**
* @param {string} suiteId
* @param {Object} state
* @param {Object} Options
* @param {boolean} [Options.draft]
* @returns Vest output object.
*/
const produce = (state, { draft } = {}) =>
Expand Down
1 change: 1 addition & 0 deletions packages/vest/src/core/state/hasRemainingTests/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Checks if a given tests, or the suite as a whole still have remaining tests.
* @param {Object} state
* @param {string} [fieldName]
* @returns {Boolean}
*/
Expand Down

0 comments on commit 8e5add2

Please sign in to comment.