Skip to content

Commit ce148a0

Browse files
committed
test: remove custom assertion messages in reporter tests
Some we wrongly placed (detected by Prettier) They do not add information in case of failure.
1 parent 9906eca commit ce148a0

File tree

2 files changed

+13
-33
lines changed

2 files changed

+13
-33
lines changed

test/reporter/test-reporter-junit.js

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ test('reporter.junit(): passing', (t) => {
7171
}
7272

7373
junitReporter(logger, passingInput);
74-
t.equal(
75-
output,
76-
passingExpected,
77-
'we should get expected output when all' + ' modules pass'
78-
);
74+
t.equal(output, passingExpected);
7975
t.end();
8076
});
8177

@@ -94,11 +90,11 @@ test('reporter.junit(): bad output', (t) => {
9490

9591
t.doesNotThrow(() => {
9692
junitReporter(logger, corruptXml);
97-
}, 'parsing bad data should not throw');
93+
});
9894

9995
t.doesNotThrow(() => {
10096
junitReporter(logger, corruptXmlToo);
101-
}, 'parsing bad data should not throw');
97+
});
10298

10399
t.ok(output);
104100
});
@@ -112,8 +108,7 @@ test('reporter.junit(): failing', (t) => {
112108
}
113109

114110
junitReporter(logger, failingInput);
115-
(t.equal(output, failingExpected),
116-
'we should get the expected output when a' + ' module fails');
111+
t.equal(output, failingExpected);
117112
t.end();
118113
});
119114

@@ -127,19 +122,14 @@ test('reporter.junit(): parser', async (t) => {
127122

128123
junitReporter(logger, failingInput);
129124
const result = await parseString(output);
130-
t.same(
131-
result,
132-
junitParserExpected,
133-
'we should get the expected output when a module fails'
134-
);
125+
t.same(result, junitParserExpected);
135126
});
136127

137128
test('reporter.junit(): write to disk', (t) => {
138129
t.plan(1);
139130
junitReporter(outputFile, passingInput);
140131
const expected = readFileSync(outputFile, 'utf8');
141-
(t.equal(expected, passingExpected),
142-
'the file on disk should match the' + ' expected output');
132+
t.equal(expected, passingExpected);
143133
t.end();
144134
});
145135

@@ -149,8 +139,7 @@ test('reporter.junit(): append to disk', (t) => {
149139
writeFileSync(outputFileAppend, appendStartFile);
150140
junitReporter(outputFileAppend, passingInput, true);
151141
const expected = readFileSync(outputFileAppend, 'utf-8');
152-
(t.equal(expected, passingExpectedAppend),
153-
'the file on disk should match the' + ' expected output');
142+
t.equal(expected, passingExpectedAppend);
154143
t.end();
155144
});
156145

test/reporter/test-reporter-tap.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ test('reporter.tap(): passing', (t) => {
6262
}
6363

6464
tapReporter(logger, passingInput);
65-
t.equal(
66-
output,
67-
passingExpected,
68-
'we should get expected output when all' + ' modules pass'
69-
);
65+
t.equal(output, passingExpected);
7066
t.end();
7167
});
7268

@@ -79,8 +75,7 @@ test('reporter.tap(): failing', (t) => {
7975
}
8076

8177
tapReporter(logger, failingInput);
82-
(t.equal(output, failingExpected),
83-
'we should get the expected output when a' + ' module fails');
78+
t.equal(output, failingExpected);
8479
t.end();
8580
});
8681

@@ -96,8 +91,7 @@ test('reporter.tap(): parser', (t) => {
9691
// `results` contains JS classes that are not considered same as the
9792
// plain objects loaded from the JSON file.
9893
const plainResults = JSON.parse(JSON.stringify(results));
99-
(t.same(plainResults, tapParserExpected),
100-
'the tap parser should correctly' + ' parse the tap file');
94+
t.same(plainResults, tapParserExpected);
10195
t.end();
10296
});
10397
str(output).pipe(p);
@@ -107,8 +101,7 @@ test('reporter.tap(): write to disk', (t) => {
107101
t.plan(1);
108102
tapReporter(outputFile, passingInput);
109103
const expected = readFileSync(outputFile, 'utf8');
110-
(t.equal(expected, passingExpected),
111-
'the file on disk should match the' + ' expected output');
104+
t.equal(expected, passingExpected);
112105
t.end();
113106
});
114107

@@ -118,17 +111,15 @@ test('reporter.tap(): append to disk', (t) => {
118111
writeFileSync(outputFileAppend, appendStartFile);
119112
tapReporter(outputFileAppend, passingInput, true);
120113
const expected = readFileSync(outputFileAppend, 'utf8');
121-
(t.equal(expected, passingExpectedAppend),
122-
'the file on disk should match the' + ' expected output');
114+
t.equal(expected, passingExpectedAppend);
123115
t.end();
124116
});
125117

126118
test('reporter.tap(): append to disk when file does not exist', (t) => {
127119
t.plan(1);
128120
tapReporter(outputFileAppendBlank, passingInput, true);
129121
const expected = readFileSync(outputFileAppendBlank, 'utf8');
130-
(t.equal(expected, passingExpected),
131-
'the file on disk should match the' + ' expected output');
122+
t.equal(expected, passingExpected);
132123
t.end();
133124
});
134125

0 commit comments

Comments
 (0)