diff --git a/lib/reporters/mini.js b/lib/reporters/mini.js index 05b92a926..97119fd23 100644 --- a/lib/reporters/mini.js +++ b/lib/reporters/mini.js @@ -233,7 +233,8 @@ class MiniReporter { } if (runStatus.failFastEnabled === true && runStatus.remainingCount > 0 && runStatus.failCount > 0) { - status += '\n\n ' + colors.information('`--fail-fast` is on. Any number of tests may have been skipped'); + const remaining = 'At least ' + runStatus.remainingCount + ' ' + plur('test was', 'tests were', runStatus.remainingCount) + ' skipped.'; + status += '\n\n ' + colors.information('`--fail-fast` is on. ' + remaining); } if (runStatus.hasExclusive === true && runStatus.remainingCount > 0) { diff --git a/lib/reporters/verbose.js b/lib/reporters/verbose.js index bd7f8cf02..6a92606bd 100644 --- a/lib/reporters/verbose.js +++ b/lib/reporters/verbose.js @@ -128,7 +128,8 @@ class VerboseReporter { } if (runStatus.failFastEnabled === true && runStatus.remainingCount > 0 && runStatus.failCount > 0) { - output += '\n\n\n ' + colors.information('`--fail-fast` is on. Any number of tests may have been skipped'); + const remaining = 'At least ' + runStatus.remainingCount + ' ' + plur('test was', 'tests were', runStatus.remainingCount) + ' skipped.'; + output += '\n\n\n ' + colors.information('`--fail-fast` is on. ' + remaining); } if (runStatus.hasExclusive === true && runStatus.remainingCount > 0) { diff --git a/test/reporters/mini.js b/test/reporters/mini.js index 804c055d3..934b0ce8d 100644 --- a/test/reporters/mini.js +++ b/test/reporters/mini.js @@ -643,7 +643,24 @@ test('results when fail-fast is enabled', t => { compareLineOutput(t, output, [ '', '', - ' ' + colors.information('`--fail-fast` is on. Any number of tests may have been skipped') + ' ' + colors.information('`--fail-fast` is on. At least 1 test was skipped.') + ]); + t.end(); +}); + +test('results when fail-fast is enabled with multiple skipped tests', t => { + const reporter = miniReporter(); + const runStatus = { + remainingCount: 2, + failCount: 1, + failFastEnabled: true + }; + + const output = reporter.finish(runStatus); + compareLineOutput(t, output, [ + '', + '', + ' ' + colors.information('`--fail-fast` is on. At least 2 tests were skipped.') ]); t.end(); }); diff --git a/test/reporters/verbose.js b/test/reporters/verbose.js index 4286c1696..2602af972 100644 --- a/test/reporters/verbose.js +++ b/test/reporters/verbose.js @@ -617,7 +617,31 @@ test('results when fail-fast is enabled', t => { ' ' + chalk.red('1 test failed') + time, '', '', - ' ' + colors.information('`--fail-fast` is on. Any number of tests may have been skipped'), + ' ' + colors.information('`--fail-fast` is on. At least 1 test was skipped.'), + '' + ].join('\n'); + + t.is(output, expectedOutput); + t.end(); +}); + +test('results when fail-fast is enabled with multiple skipped tests', t => { + const reporter = new VerboseReporter(); + const runStatus = createRunStatus(); + runStatus.remainingCount = 2; + runStatus.failCount = 1; + runStatus.failFastEnabled = true; + runStatus.tests = [{ + title: 'failed test' + }]; + + const output = reporter.finish(runStatus); + const expectedOutput = [ + '', + ' ' + chalk.red('1 test failed') + time, + '', + '', + ' ' + colors.information('`--fail-fast` is on. At least 2 tests were skipped.'), '' ].join('\n');