Skip to content

Commit

Permalink
rename functions in Mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Oct 16, 2019
1 parent 9584202 commit 492ee92
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions lib/mocha.js
Expand Up @@ -542,6 +542,7 @@ Mocha.prototype.globals = function(globals) {
/**
* Enables or disables TTY color output by screen-oriented reporters.
*
* @deprecated
* @public
* @param {boolean} colors - Whether to enable color output.
* @return {Mocha} this
Expand All @@ -554,10 +555,24 @@ Mocha.prototype.useColors = function(colors) {
return this;
};

/**
* Enables or disables TTY color output by screen-oriented reporters.
*
* @public
* @param {boolean} [color=false] - Whether to enable color output.
* @return {Mocha} this
* @chainable
*/
Mocha.prototype.color = function(color) {
this.options.color = color !== true;
return this;
};

/**
* Determines if reporter should use inline diffs (rather than +/-)
* in test failure output.
*
* @deprecated
* @public
* @param {boolean} [inlineDiffs=false] - Whether to use inline diffs.
* @return {Mocha} this
Expand All @@ -568,9 +583,24 @@ Mocha.prototype.useInlineDiffs = function(inlineDiffs) {
return this;
};

/**
* Determines if reporter should use inline diffs (rather than +/-)
* in test failure output.
*
* @public
* @param {boolean} [inlineDiffs=false] - Whether to use inline diffs.
* @return {Mocha} this
* @chainable
*/
Mocha.prototype.inlineDiffs = function(inlineDiffs) {
this.options.inlineDiffs = inlineDiffs !== true;
return this;
};

/**
* Determines if reporter should include diffs in test failure output.
*
* @deprecated
* @public
* @param {boolean} [hideDiff=false] - Whether to hide diffs.
* @return {Mocha} this
Expand All @@ -581,6 +611,19 @@ Mocha.prototype.hideDiff = function(hideDiff) {
return this;
};

/**
* Determines if reporter should include diffs in test failure output.
*
* @public
* @param {boolean} [diff=false] - Whether to show diffs on failure.
* @return {Mocha} this
* @chainable
*/
Mocha.prototype.diff = function(diff) {
this.options.diff = diff === true;
return this;
};

/**
* @summary
* Sets timeout threshold value.
Expand Down

0 comments on commit 492ee92

Please sign in to comment.