-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement API documentation using npm:documantation.
Fixes #3138 Replaces and closes #3239 basically working Suite and utils work Runner and Suite datatypes work Hook extends Runnable - at least link in description hook is child of mocha and has error first solid pass Remove attempted module link from Hook to Runnable because of documentationjs/documentation#820 Switch API documenation to html output, link to them, include in site build Update TOC Bring lock file in sync with package.json Linting Update package-lock.json
- Loading branch information
Showing
28 changed files
with
5,885 additions
and
1,645 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,5 @@ yarn.lock | |
*_REMOTE_* | ||
docs/_site | ||
docs/_dist | ||
docs/api | ||
.vscode/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,10 @@ | |
* Copyright(c) 2011 TJ Holowaychuk <[email protected]> | ||
* MIT Licensed | ||
*/ | ||
|
||
/** | ||
* @namespace Mocha | ||
* @module Mocha | ||
*/ | ||
/** | ||
* Module dependencies. | ||
*/ | ||
|
@@ -34,11 +37,25 @@ if (!process.browser) { | |
* Expose internals. | ||
*/ | ||
|
||
/** | ||
* @public | ||
* @class utils | ||
* @memberof Mocha | ||
*/ | ||
exports.utils = utils; | ||
exports.interfaces = require('./interfaces'); | ||
/** | ||
* | ||
* @memberof Mocha | ||
* @public | ||
*/ | ||
exports.reporters = reporters; | ||
exports.Runnable = require('./runnable'); | ||
exports.Context = require('./context'); | ||
/** | ||
* | ||
* @memberof Mocha | ||
*/ | ||
exports.Runner = require('./runner'); | ||
exports.Suite = require('./suite'); | ||
exports.Hook = require('./hook'); | ||
|
@@ -71,6 +88,8 @@ function image (name) { | |
* - `fullTrace` display the full stack-trace on failing | ||
* - `grep` string or regexp to filter tests with | ||
* | ||
* @public | ||
* @class Mocha | ||
* @param {Object} options | ||
* @api public | ||
*/ | ||
|
@@ -106,6 +125,7 @@ function Mocha (options) { | |
/** | ||
* Enable or disable bailing on the first failure. | ||
* | ||
* @public | ||
* @api public | ||
* @param {boolean} [bail] | ||
*/ | ||
|
@@ -120,6 +140,7 @@ Mocha.prototype.bail = function (bail) { | |
/** | ||
* Add test `file`. | ||
* | ||
* @public | ||
* @api public | ||
* @param {string} file | ||
*/ | ||
|
@@ -131,6 +152,7 @@ Mocha.prototype.addFile = function (file) { | |
/** | ||
* Set reporter to `reporter`, defaults to "spec". | ||
* | ||
* @public | ||
* @param {String|Function} reporter name or constructor | ||
* @param {Object} reporterOptions optional options | ||
* @api public | ||
|
@@ -181,7 +203,7 @@ Mocha.prototype.reporter = function (reporter, reporterOptions) { | |
|
||
/** | ||
* Set test UI `name`, defaults to "bdd". | ||
* | ||
* @public | ||
* @api public | ||
* @param {string} bdd | ||
*/ | ||
|
@@ -260,6 +282,7 @@ Mocha.prototype._growl = function (runner, reporter) { | |
/** | ||
* Escape string and add it to grep as a regexp. | ||
* | ||
* @public | ||
* @api public | ||
* @param str | ||
* @returns {Mocha} | ||
|
@@ -271,6 +294,7 @@ Mocha.prototype.fgrep = function (str) { | |
/** | ||
* Add regexp to grep, if `re` is a string it is escaped. | ||
* | ||
* @public | ||
* @param {RegExp|String} re | ||
* @return {Mocha} | ||
* @api public | ||
|
@@ -290,6 +314,7 @@ Mocha.prototype.grep = function (re) { | |
/** | ||
* Invert `.grep()` matches. | ||
* | ||
* @public | ||
* @return {Mocha} | ||
* @api public | ||
*/ | ||
|
@@ -301,6 +326,7 @@ Mocha.prototype.invert = function () { | |
/** | ||
* Ignore global leaks. | ||
* | ||
* @public | ||
* @param {Boolean} ignore | ||
* @return {Mocha} | ||
* @api public | ||
|
@@ -317,6 +343,7 @@ Mocha.prototype.ignoreLeaks = function (ignore) { | |
* | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
*/ | ||
Mocha.prototype.checkLeaks = function () { | ||
this.options.ignoreLeaks = false; | ||
|
@@ -328,6 +355,7 @@ Mocha.prototype.checkLeaks = function () { | |
* | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
*/ | ||
Mocha.prototype.fullTrace = function () { | ||
this.options.fullStackTrace = true; | ||
|
@@ -339,6 +367,7 @@ Mocha.prototype.fullTrace = function () { | |
* | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
*/ | ||
Mocha.prototype.growl = function () { | ||
this.options.growl = true; | ||
|
@@ -351,6 +380,7 @@ Mocha.prototype.growl = function () { | |
* @param {Array|String} globals | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
* @param {Array|string} globals | ||
* @return {Mocha} | ||
*/ | ||
|
@@ -365,6 +395,7 @@ Mocha.prototype.globals = function (globals) { | |
* @param {Boolean} colors | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
* @param {boolean} colors | ||
* @return {Mocha} | ||
*/ | ||
|
@@ -381,6 +412,7 @@ Mocha.prototype.useColors = function (colors) { | |
* @param {Boolean} inlineDiffs | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
* @param {boolean} inlineDiffs | ||
* @return {Mocha} | ||
*/ | ||
|
@@ -395,6 +427,7 @@ Mocha.prototype.useInlineDiffs = function (inlineDiffs) { | |
* @param {Boolean} hideDiff | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
* @param {boolean} hideDiff | ||
* @return {Mocha} | ||
*/ | ||
|
@@ -409,6 +442,7 @@ Mocha.prototype.hideDiff = function (hideDiff) { | |
* @param {Number} timeout | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
* @param {number} timeout | ||
* @return {Mocha} | ||
*/ | ||
|
@@ -423,6 +457,7 @@ Mocha.prototype.timeout = function (timeout) { | |
* @param {Number} retry times | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
*/ | ||
Mocha.prototype.retries = function (n) { | ||
this.suite.retries(n); | ||
|
@@ -435,6 +470,7 @@ Mocha.prototype.retries = function (n) { | |
* @param {Number} slow | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
* @param {number} slow | ||
* @return {Mocha} | ||
*/ | ||
|
@@ -449,6 +485,7 @@ Mocha.prototype.slow = function (slow) { | |
* @param {Boolean} enabled | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
* @param {boolean} enabled | ||
* @return {Mocha} | ||
*/ | ||
|
@@ -462,6 +499,7 @@ Mocha.prototype.enableTimeouts = function (enabled) { | |
* | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
*/ | ||
Mocha.prototype.asyncOnly = function () { | ||
this.options.asyncOnly = true; | ||
|
@@ -472,6 +510,7 @@ Mocha.prototype.asyncOnly = function () { | |
* Disable syntax highlighting (in browser). | ||
* | ||
* @api public | ||
* @public | ||
*/ | ||
Mocha.prototype.noHighlighting = function () { | ||
this.options.noHighlighting = true; | ||
|
@@ -483,6 +522,7 @@ Mocha.prototype.noHighlighting = function () { | |
* | ||
* @return {Mocha} | ||
* @api public | ||
* @public | ||
*/ | ||
Mocha.prototype.allowUncaught = function () { | ||
this.options.allowUncaught = true; | ||
|
@@ -528,6 +568,7 @@ Mocha.prototype.forbidPending = function () { | |
* cache first in whichever manner best suits your needs. | ||
* | ||
* @api public | ||
* @public | ||
* @param {Function} fn | ||
* @return {Runner} | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.