Skip to content

Commit

Permalink
Remove GLOBALS in api docs (#4343)
Browse files Browse the repository at this point in the history
* Remove globals in api docs

* Fix runnable + suite

* Fix Runner issues

* rename @module tags 2 b filepaths from /lib
  • Loading branch information
craigtaub authored Jul 2, 2020
1 parent f77aa7a commit 7d3151d
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/browser/progress.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

/**
@module browser/Progress
*/

/**
* Expose `Progress`.
*/
Expand Down
1 change: 1 addition & 0 deletions lib/cli/collect-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ module.exports = ({ignore, extension, file, recursive, sort, spec} = {}) => {

/**
* An object to configure how Mocha gathers test files
* @private
* @typedef {Object} FileCollectionOptions
* @property {string[]} extension - File extensions to use
* @property {string[]} spec - Files, dirs, globs to run
Expand Down
5 changes: 5 additions & 0 deletions lib/interfaces/common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

/**
@module interfaces/common
*/

var Suite = require('../suite');
var errors = require('../errors');
var createMissingArgumentError = errors.createMissingArgumentError;
Expand All @@ -9,6 +13,7 @@ var createForbiddenExclusivityError = errors.createForbiddenExclusivityError;
/**
* Functions common to more than one interface.
*
* @private
* @param {Suite[]} suites
* @param {Context} context
* @param {Mocha} mocha
Expand Down
9 changes: 9 additions & 0 deletions lib/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,28 @@ exports = module.exports = Mocha;
/**
* A Mocha instance is a finite state machine.
* These are the states it can be in.
* @private
*/
var mochaStates = utils.defineConstants({
/**
* Initial state of the mocha instance
* @private
*/
INIT: 'init',
/**
* Mocha instance is running tests
* @private
*/
RUNNING: 'running',
/**
* Mocha instance is done running tests and references to test functions and hooks are cleaned.
* You can reset this state by unloading the test files.
* @private
*/
REFERENCES_CLEANED: 'referencesCleaned',
/**
* Mocha instance is disposed and can no longer be used.
* @private
*/
DISPOSED: 'disposed'
});
Expand All @@ -67,6 +72,7 @@ if (!utils.isBrowser() && typeof module.paths !== 'undefined') {

/**
* Expose internals.
* @private
*/

exports.utils = utils;
Expand Down Expand Up @@ -921,6 +927,7 @@ Object.defineProperty(Mocha.prototype, 'version', {
/**
* Callback to be invoked when test execution is complete.
*
* @private
* @callback DoneCB
* @param {number} failures - Number of failures that occurred.
*/
Expand Down Expand Up @@ -1091,6 +1098,7 @@ Mocha.prototype.lazyLoadFiles = function lazyLoadFiles(enable) {

/**
* An alternative way to define root hooks that works with parallel runs.
* @private
* @typedef {Object} MochaRootHookObject
* @property {Function|Function[]} [beforeAll] - "Before all" hook(s)
* @property {Function|Function[]} [beforeEach] - "Before each" hook(s)
Expand All @@ -1100,6 +1108,7 @@ Mocha.prototype.lazyLoadFiles = function lazyLoadFiles(enable) {

/**
* An function that returns a {@link MochaRootHookObject}, either sync or async.
* @private
* @callback MochaRootHookFunction
* @returns {MochaRootHookObject|Promise<MochaRootHookObject>}
*/
2 changes: 2 additions & 0 deletions lib/nodejs/parallel-buffered-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,14 @@ module.exports = ParallelBufferedRunner;

/**
* Listener function intended to be bound to `Process.SIGINT` event
* @private
* @callback SigIntListener
* @returns {Promise<void>}
*/

/**
* A function accepting a test file path and returning the results of a test run
* @private
* @callback FileRunner
* @param {string} filename - File to run
* @returns {Promise<SerializedWorkerResult>}
Expand Down
2 changes: 2 additions & 0 deletions lib/nodejs/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ exports.SerializableWorkerResult = SerializableWorkerResult;
/**
* The result of calling `SerializableEvent.serialize`, as received
* by the deserializer.
* @private
* @typedef {Object} SerializedEvent
* @property {object?} data - Optional serialized data
* @property {object?} error - Optional serialized `Error`
Expand All @@ -395,6 +396,7 @@ exports.SerializableWorkerResult = SerializableWorkerResult;
/**
* The result of calling `SerializableWorkerResult.serialize` as received
* by the deserializer.
* @private
* @typedef {Object} SerializedWorkerResult
* @property {number} failureCount - Number of failures
* @property {SerializedEvent[]} events - Serialized events
Expand Down
4 changes: 4 additions & 0 deletions lib/pending.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

/**
@module Pending
*/

module.exports = Pending;

/**
Expand Down
1 change: 1 addition & 0 deletions lib/runnable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var createMultipleDoneError = errors.createMultipleDoneError;

/**
* Save timer references to avoid Sinon interfering (see GH-237).
* @private
*/
var Date = global.Date;
var setTimeout = global.setTimeout;
Expand Down
2 changes: 2 additions & 0 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/**
* Module dependencies.
* @private
*/
var util = require('util');
var EventEmitter = require('events').EventEmitter;
Expand Down Expand Up @@ -31,6 +32,7 @@ var createFatalError = errors.createFatalError;

/**
* Non-enumerable globals.
* @private
* @readonly
*/
var globals = [
Expand Down
1 change: 1 addition & 0 deletions lib/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/**
* Module dependencies.
* @private
*/
var EventEmitter = require('events').EventEmitter;
var Hook = require('./hook');
Expand Down

0 comments on commit 7d3151d

Please sign in to comment.