Skip to content

Commit 6a98c46

Browse files
Improve output of doc tests command
1 parent 705e67c commit 6a98c46

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tools/doc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const path = require('path');
33
const { ORDERS } = require('../src/commands.js');
44
const docFile = path.join(__dirname, '../goml-script.md');
55

6-
const {Assert, print} = require('./utils.js');
6+
const {Assert, plural, print} = require('./utils.js');
77

88
function compareCommands(x, commands) {
99
print(`Checking ${commands.length} commands from documentation (\
@@ -80,7 +80,11 @@ function checkDoc(x = new Assert()) {
8080
if (x.getTotalRanTests() === 0) {
8181
x.addError('No commands found in doc...');
8282
}
83+
8384
const errors = x.getTotalErrors();
85+
print('');
86+
print(`<= Ending ${x.getTotalRanTests()} ${plural('test', x.getTotalRanTests())} with ` +
87+
`${x.getTotalErrors()} ${plural('error', errors)}`);
8488
x.endTestSuite(false);
8589
return errors;
8690
}

tools/ui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ async function checkUi(x) {
133133
checkImageFileForTest(
134134
x, 'tests/ui/screenshot-on-failure-failure.png', 'screenshot-on-failure.goml');
135135

136+
const errors = x.getTotalErrors();
136137
print('');
137138
print(`<= Ending ${x.getTotalRanTests()} ${plural('test', x.getTotalRanTests())} with ` +
138-
`${x.getTotalErrors()} ${plural('error', x.getTotalErrors())}`);
139+
`${x.getTotalErrors()} ${plural('error', errors)}`);
139140

140-
const errors = x.getTotalErrors();
141141
x.endTestSuite(false);
142142
return errors;
143143
}

0 commit comments

Comments
 (0)