diff --git a/README.md b/README.md index 9475e3a1..faefb317 100644 --- a/README.md +++ b/README.md @@ -44,18 +44,18 @@ You can customize the output of the reporter yourself: [see how](https://github. displayFailuresSummary: true, // display summary of all failures after execution displaySuccessfulSpec: true, // display each successful spec displayFailedSpec: true, // display each failed spec - displaySkippedSpec: false, // display each skipped spec + displayPendingSpec: false, // display each pending spec displaySpecDuration: false, // display each spec duration displaySuiteNumber: false, // display each suite number (hierarchical) colors: { success: 'green', failure: 'red', - skipped: 'cyan' + pending: 'cyan' }, prefixes: { success: '✓ ', failure: '✗ ', - skipped: '- ' + pending: '- ' }, customProcessors: [] } diff --git a/customize-output.md b/customize-output.md index 28a6a98e..a243b34a 100644 --- a/customize-output.md +++ b/customize-output.md @@ -26,7 +26,7 @@ You can then customize the following methods: * displaySuite(suite, log) * displaySuccessfulSpec(spec, log) * displayFailedSpec(spec, log) -* displaySkippedSpec(spec, log) +* displayPendingSpec(spec, log) The first argument is the jasmine object corresponding to the suite or the spec. The second argument is the log to be displayed. Those methods should return the modified log. @@ -58,7 +58,7 @@ For our example: return getTime() + " - " + log; }; - TimeProcessor.prototype.displaySkippedSpec = function (spec, log) { + TimeProcessor.prototype.displayPendingSpec = function (spec, log) { return getTime() + " - " + log; }; diff --git a/example/run-example.js b/example/run-example.js index 1701a314..676be722 100644 --- a/example/run-example.js +++ b/example/run-example.js @@ -11,7 +11,7 @@ jasmine.getEnv().addReporter(new SpecReporter({ displayFailuresSummary: true, displaySuccessfulSpec: true, displayFailedSpec: true, - displaySkippedSpec: false, + displayPendingSpec: true, displaySpecDuration: false, displaySuiteNumber: false, colors: { @@ -22,7 +22,7 @@ jasmine.getEnv().addReporter(new SpecReporter({ prefixes: { success: '✓ ', failure: '✗ ', - skipped: '- ' + pending: '- ' }, customProcessors: [] })); diff --git a/spec/custom-processor.spec.coffee b/spec/custom-processor.spec.coffee index 3d4a3244..ec26a946 100644 --- a/spec/custom-processor.spec.coffee +++ b/spec/custom-processor.spec.coffee @@ -8,7 +8,7 @@ describe 'spec reporter', -> describe 'with custom processor', -> beforeEach -> @reporter = new SpecReporter - displaySkippedSpec: true + displayPendingSpec: true customProcessors: [TestProcessor] test: ' TEST' @@ -39,9 +39,9 @@ describe 'spec reporter', -> .contains /failed spec TEST/ - it 'should report skipped with custom display', -> + it 'should report pending with custom display', -> expect(new Test(@reporter,-> @describe 'suite', -> - @xit 'skipped spec', -> + @xit 'pending spec', -> ).outputs) - .contains /skipped spec TEST/ + .contains /pending spec TEST/ diff --git a/spec/helpers/test-processor.js b/spec/helpers/test-processor.js index 76150393..a096b116 100644 --- a/spec/helpers/test-processor.js +++ b/spec/helpers/test-processor.js @@ -18,7 +18,7 @@ TestProcessor.prototype.displayFailedSpec = function (spec, log) { return log + this.test; }; -TestProcessor.prototype.displaySkippedSpec = function (spec, log) { +TestProcessor.prototype.displayPendingSpec = function (spec, log) { return log + this.test; }; diff --git a/spec/jasmine-spec-reporter.spec.coffee b/spec/jasmine-spec-reporter.spec.coffee index 5a9263cb..50479727 100644 --- a/spec/jasmine-spec-reporter.spec.coffee +++ b/spec/jasmine-spec-reporter.spec.coffee @@ -27,12 +27,12 @@ describe 'spec reporter', -> .contains /✗ failed spec/ - it 'should not report skipped', -> + it 'should not report pending', -> expect(new Test(@reporter,-> @describe 'suite', -> - @xit 'skipped spec', -> + @xit 'pending spec', -> ).outputs) - .not.contains /skipped spec/ + .not.contains /pending spec/ describe 'when failed spec', -> @@ -192,22 +192,22 @@ describe 'spec reporter', -> ] - it 'should report skipped whith success', -> + it 'should report pending whith success', -> expect(new Test(@reporter,-> @describe 'suite', -> @xit 'spec', -> ).summary) - .contains 'Executed 0 of 1 spec SUCCESS (skipped 1) in {time}.' + .contains 'Executed 0 of 1 spec SUCCESS (1 PENDING) in {time}.' - it 'should report skipped whith failure', -> + it 'should report pending with failure', -> expect(new Test(@reporter,-> @describe 'suite', -> @xit 'spec', -> @it 'spec', -> @failed() ).summary) - .toContain 'Executed 1 of 2 specs (1 FAILED) (skipped 1) in {time}.' + .toContain 'Executed 1 of 2 specs (1 FAILED) (1 PENDING) in {time}.' describe 'with stacktrace enabled', -> @@ -352,17 +352,17 @@ describe 'spec reporter', -> expect(outputs).not.contains /failed spec/ - describe 'with skipped spec enabled', -> + describe 'with pending spec enabled', -> beforeEach -> - @reporter = new SpecReporter({displaySkippedSpec: true}) + @reporter = new SpecReporter({displayPendingSpec: true}) describe 'when spec', -> - it 'should report skipped', -> + it 'should report pending', -> expect(new Test(@reporter,-> @describe 'suite', -> - @xit 'skipped spec', -> + @xit 'pending spec', -> ).outputs) - .contains /- skipped spec/ + .contains /- pending spec/ describe 'with spec duration enabled', -> @@ -390,7 +390,7 @@ describe 'spec reporter', -> describe 'with prefixes set to empty strings', -> beforeEach -> - @reporter = new SpecReporter({displaySkippedSpec: true, prefixes: {success: '', failure: '', skipped: ''}}) + @reporter = new SpecReporter({displayPendingSpec: true, prefixes: {success: '', failure: '', pending: ''}}) describe 'when spec', -> it 'should report success', -> @@ -411,17 +411,17 @@ describe 'spec reporter', -> .not.contains /✗/ - it 'should report skipped', -> + it 'should report pending', -> expect(new Test(@reporter,-> @describe 'suite', -> - @xit 'skipped spec', -> + @xit 'pending spec', -> ).outputs) .not.contains /-/ describe 'with prefixes set to valid strings', -> beforeEach -> - @reporter = new SpecReporter({displaySkippedSpec: true, prefixes: {success: 'Pass ', failure: 'Fail ', skipped: 'Skip '}}) + @reporter = new SpecReporter({displayPendingSpec: true, prefixes: {success: 'Pass ', failure: 'Fail ', pending: 'Skip '}}) describe 'when spec', -> it 'should report success', -> @@ -442,9 +442,9 @@ describe 'spec reporter', -> .not.contains /✗/ - it 'should report skipped', -> + it 'should report pending', -> expect(new Test(@reporter,-> @describe 'suite', -> - @xit 'skipped spec', -> + @xit 'pending spec', -> ).outputs) .not.contains /-/ diff --git a/src/display-processor.js b/src/display-processor.js index eb0d9593..58cbab9f 100644 --- a/src/display-processor.js +++ b/src/display-processor.js @@ -12,7 +12,7 @@ DisplayProcessor.prototype.displayFailedSpec = function (spec, log) { return log; }; -DisplayProcessor.prototype.displaySkippedSpec = function (spec, log) { +DisplayProcessor.prototype.displayPendingSpec = function (spec, log) { return log; }; diff --git a/src/jasmine-spec-reporter.js b/src/jasmine-spec-reporter.js index e0a6ab92..12c6605b 100644 --- a/src/jasmine-spec-reporter.js +++ b/src/jasmine-spec-reporter.js @@ -23,7 +23,7 @@ function initColors(options) { colors.setTheme({ success: options.colors && options.colors.success ? options.colors.success : 'green', failure: options.colors && options.colors.failure ? options.colors.failure : 'red', - skipped: options.colors && options.colors.skipped ? options.colors.skipped : 'cyan' + pending: options.colors && options.colors.pending ? options.colors.pending : 'cyan' }); } @@ -79,8 +79,8 @@ SpecReporter.prototype = { specDone: function (spec) { this.metrics.stopSpec(spec); if (spec.status == 'pending') { - this.metrics.skippedSpecs++; - this.display.skipped(spec); + this.metrics.pendingSpecs++; + this.display.pending(spec); } else if (spec.status == 'passed') { this.metrics.successfulSpecs++; this.display.successful(spec); diff --git a/src/processors/default-processor.js b/src/processors/default-processor.js index 2b2425c8..ff1b4286 100644 --- a/src/processors/default-processor.js +++ b/src/processors/default-processor.js @@ -14,6 +14,6 @@ function displaySpecDescription(spec) { DefaultProcessor.prototype.displaySuccessfulSpec = displaySpecDescription; DefaultProcessor.prototype.displayFailedSpec = displaySpecDescription; -DefaultProcessor.prototype.displaySkippedSpec = displaySpecDescription; +DefaultProcessor.prototype.displayPendingSpec = displaySpecDescription; module.exports = DefaultProcessor; diff --git a/src/processors/spec-colors-processor.js b/src/processors/spec-colors-processor.js index 9bc68e93..fa5715c7 100644 --- a/src/processors/spec-colors-processor.js +++ b/src/processors/spec-colors-processor.js @@ -12,8 +12,8 @@ SpecColorsProcessor.prototype.displayFailedSpec = function (spec, log) { return log.failure; }; -SpecColorsProcessor.prototype.displaySkippedSpec = function (spec, log) { - return log.skipped; +SpecColorsProcessor.prototype.displayPendingSpec = function (spec, log) { + return log.pending; }; module.exports = SpecColorsProcessor; diff --git a/src/processors/spec-prefixes-processor.js b/src/processors/spec-prefixes-processor.js index a349cc34..5edec212 100644 --- a/src/processors/spec-prefixes-processor.js +++ b/src/processors/spec-prefixes-processor.js @@ -4,7 +4,7 @@ function SpecPrefixesProcessor(prefixes) { this.prefixes = { success: prefixes && prefixes.success !== undefined ? prefixes.success : '✓ ', failure: prefixes && prefixes.failure !== undefined ? prefixes.failure : '✗ ', - skipped: prefixes && prefixes.skipped !== undefined ? prefixes.skipped : '- ' + pending: prefixes && prefixes.pending !== undefined ? prefixes.pending : '- ' } } @@ -18,8 +18,8 @@ SpecPrefixesProcessor.prototype.displayFailedSpec = function (spec, log) { return this.prefixes.failure + log; }; -SpecPrefixesProcessor.prototype.displaySkippedSpec = function (spec, log) { - return this.prefixes.skipped + log; +SpecPrefixesProcessor.prototype.displayPendingSpec = function (spec, log) { + return this.prefixes.pending + log; }; module.exports = SpecPrefixesProcessor; diff --git a/src/spec-display.js b/src/spec-display.js index dd048cf0..c219674a 100644 --- a/src/spec-display.js +++ b/src/spec-display.js @@ -8,7 +8,7 @@ var SpecDisplay = function (options, displayProcessors) { this.displayFailuresSummary = options.displayFailuresSummary !== false; this.displaySuccessfulSpec = options.displaySuccessfulSpec !== false; this.displayFailedSpec = options.displayFailedSpec !== false; - this.displaySkippedSpec = options.displaySkippedSpec || false; + this.displayPendingSpec = options.displayPendingSpec || false; this.displayWithoutColors = options.colors === false; this.displayProcessors = displayProcessors; }; @@ -18,7 +18,7 @@ SpecDisplay.prototype = { var execution = 'Executed ' + metrics.executedSpecs + ' of ' + metrics.totalSpecs + (metrics.totalSpecs === 1 ? ' spec ' : ' specs '); var successful = (metrics.failedSpecs == 0) ? 'SUCCESS ' : ''; var failed = (metrics.failedSpecs > 0) ? '(' + metrics.failedSpecs + ' FAILED) ' : ''; - var skipped = (metrics.skippedSpecs > 0) ? '(skipped ' + metrics.skippedSpecs + ') ' : ''; + var pending = (metrics.pendingSpecs > 0) ? '(' + metrics.pendingSpecs + ' PENDING) ' : ''; var duration = 'in ' + metrics.duration + '.'; this.resetIndent(); @@ -26,7 +26,7 @@ SpecDisplay.prototype = { if (this.displayFailuresSummary && metrics.failedSpecs > 0) { this.failuresSummary(); } - this.log(execution + successful.success + failed.failure + skipped + duration); + this.log(execution + successful.success + failed.failure + pending.pending + duration); }, failuresSummary: function () { @@ -71,12 +71,12 @@ SpecDisplay.prototype = { } }, - skipped: function (spec) { - if (this.displaySkippedSpec) { + pending: function (spec) { + if (this.displayPendingSpec) { this.ensureSuiteDisplayed(spec); var log = null; this.displayProcessors.forEach(function (displayProcessor) { - log = displayProcessor.displaySkippedSpec(spec, log); + log = displayProcessor.displayPendingSpec(spec, log); }); this.log(log); } diff --git a/src/spec-metrics.js b/src/spec-metrics.js index 9066e383..7e29f87c 100644 --- a/src/spec-metrics.js +++ b/src/spec-metrics.js @@ -4,7 +4,7 @@ var SpecMetrics = function () { this.duration = null; this.successfulSpecs = 0; this.failedSpecs = 0; - this.skippedSpecs = 0; + this.pendingSpecs = 0; this.executedSpecs = 0; this.totalSpecs = 0; }; @@ -16,7 +16,7 @@ SpecMetrics.prototype = { stop: function () { this.duration = this.formatDuration((new Date()).getTime() - this.startTime); - this.totalSpecs = this.failedSpecs + this.successfulSpecs + this.skippedSpecs; + this.totalSpecs = this.failedSpecs + this.successfulSpecs + this.pendingSpecs; this.executedSpecs = this.failedSpecs + this.successfulSpecs; },