Skip to content

Commit 54b9518

Browse files
committed
Remove anonymous test handling in verbose reporter
There are no more anonymous tests.
1 parent f38fb7b commit 54b9518

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

lib/logger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Logger {
2424
}
2525

2626
test(test, runStatus) {
27-
this.write(this.reporter.test(test, runStatus), runStatus);
27+
this.write(this.reporter.test(test), runStatus);
2828
}
2929

3030
unhandledError(err, runStatus) {

lib/reporters/verbose.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class VerboseReporter {
2424
return '';
2525
}
2626

27-
test(test, runStatus) {
27+
test(test) {
2828
const lines = [];
2929
if (test.error) {
3030
lines.push(' ' + colors.error(figures.cross) + ' ' + test.title + ' ' + colors.error(test.error.message));
@@ -34,8 +34,6 @@ class VerboseReporter {
3434
lines.push(' ' + colors.skip('- ' + test.title));
3535
} else if (test.failing) {
3636
lines.push(' ' + colors.error(figures.tick) + ' ' + colors.error(test.title));
37-
} else if (runStatus.fileCount === 1 && runStatus.testCount === 1 && test.title === '[anonymous]') {
38-
// No output
3937
} else {
4038
// Display duration only over a threshold
4139
const threshold = 100;

test/reporters/verbose.js

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ test('passing test and duration less than threshold', t => {
7070
const actualOutput = reporter.test({
7171
title: 'passed',
7272
duration: 90
73-
}, createRunStatus());
73+
});
7474

7575
const expectedOutput = ' ' + colors.green(figures.tick) + ' passed';
7676

@@ -84,32 +84,21 @@ test('passing test and duration greater than threshold', t => {
8484
const actualOutput = reporter.test({
8585
title: 'passed',
8686
duration: 150
87-
}, createRunStatus());
87+
});
8888

8989
const expectedOutput = ' ' + colors.green(figures.tick) + ' passed' + colors.dimGray(' (150ms)');
9090

9191
t.is(actualOutput, expectedOutput);
9292
t.end();
9393
});
9494

95-
test('don\'t display test title if there is only one anonymous test', t => {
96-
const reporter = createReporter();
97-
98-
const output = reporter.test({
99-
title: '[anonymous]'
100-
}, createRunStatus());
101-
102-
t.is(output, undefined);
103-
t.end();
104-
});
105-
10695
test('known failure test', t => {
10796
const reporter = createReporter();
10897

10998
const actualOutput = reporter.test({
11099
title: 'known failure',
111100
failing: true
112-
}, createRunStatus());
101+
});
113102

114103
const expectedOutput = ' ' + colors.red(figures.tick) + ' ' + colors.red('known failure');
115104

@@ -125,7 +114,7 @@ test('failing test', t => {
125114
error: {
126115
message: 'assertion failed'
127116
}
128-
}, createRunStatus());
117+
});
129118

130119
const expectedOutput = ' ' + colors.red(figures.cross) + ' failed ' + colors.red('assertion failed');
131120

@@ -139,7 +128,7 @@ test('skipped test', t => {
139128
const actualOutput = reporter.test({
140129
title: 'skipped',
141130
skip: true
142-
}, createRunStatus());
131+
});
143132

144133
const expectedOutput = ' ' + colors.yellow('- skipped');
145134

@@ -154,7 +143,7 @@ test('todo test', t => {
154143
title: 'todo',
155144
skip: true,
156145
todo: true
157-
}, createRunStatus());
146+
});
158147

159148
const expectedOutput = ' ' + colors.blue('- todo');
160149

0 commit comments

Comments
 (0)