Skip to content

Commit

Permalink
Updated jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
sgravrock committed Jun 29, 2021
1 parent ae5c062 commit 57be10c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/jasmine.js
Expand Up @@ -26,6 +26,9 @@ module.exports.ConsoleReporter = require('./reporters/console_reporter');
* @param {(JasmineOptions | undefined)} options
* @constructor
* @name Jasmine
* @example
* const Jasmine = require('jasmine');
* const jasmine = new Jasmine();
*/
function Jasmine(options) {
options = options || {};
Expand Down Expand Up @@ -313,7 +316,6 @@ function addFiles(kind) {
* after the suite has completed and the results have been finalized, but not
* necessarily before all of Jasmine's cleanup has finished.
*
* @deprecated Use the promise returned from {@link Jasmine#execute} instead.
* @param {function} onCompleteCallback
*/
Jasmine.prototype.onComplete = function(onCompleteCallback) {
Expand All @@ -324,8 +326,6 @@ Jasmine.prototype.onComplete = function(onCompleteCallback) {
* Sets whether to cause specs to only have one expectation failure.
* @function
* @name Jasmine#stopSpecOnExpectationFailure
* @deprecated Use the oneFailurePerSped option with
* {@link Jasmine#loadConfig} or a config file instead.
* @param {boolean} value Whether to cause specs to only have one expectation
* failure
*/
Expand All @@ -337,8 +337,6 @@ Jasmine.prototype.stopSpecOnExpectationFailure = function(value) {
* Sets whether to stop execution of the suite after the first spec failure.
* @function
* @name Jasmine#stopOnSpecFailure
* @deprecated Use the failFast option with {@link Jasmine#loadConfig} or a
* config file instead.
* @param {boolean} value Whether to stop execution of the suite after the
* first spec failure
*/
Expand Down
32 changes: 32 additions & 0 deletions lib/reporters/console_reporter.js
@@ -1,5 +1,14 @@
module.exports = exports = ConsoleReporter;

/**
* @classdesc A reporter that prints spec and suite results to the console.
* A ConsoleReporter is installed by default.
*
* @constructor
* @example
* const {ConsoleReporter} = require('jasmine');
* const reporter = new ConsoleReporter();
*/
function ConsoleReporter() {
var print = function() {},
showColors = false,
Expand All @@ -18,17 +27,40 @@ function ConsoleReporter() {
failedSuites = [],
stackFilter = defaultStackFilter;

/**
* Configures the reporter.
* @function
* @name ConsoleReporter#setOptions
* @param {ConsoleReporterOptions} options
*/
this.setOptions = function(options) {
if (options.print) {
print = options.print;
}

/**
* @interface ConsoleReporterOptions
*/
/**
* Whether to colorize the output
* @name ConsoleReporterOptions#showColors
* @type Boolean|undefined
* @default false
*/
showColors = options.showColors || false;
if (options.jasmineCorePath) {
jasmineCorePath = options.jasmineCorePath;
}
if (options.stackFilter) {
stackFilter = options.stackFilter;
}
/**
* A function that takes a random seed and returns the command to reproduce
* that seed. Use this to customize the output when using ConsoleReporter
* in a different command line tool.
* @name ConsoleReporterOptions#showColors
* @type Function|undefined
*/
if (options.randomSeedReproductionCmd) {
this.randomSeedReproductionCmd = options.randomSeedReproductionCmd;
}
Expand Down

0 comments on commit 57be10c

Please sign in to comment.