Skip to content

Commit e3b1f81

Browse files
committed
feat(console): Automatically generate a test ID if none exists
It uses the zero-indexed location in the test suite for that test case.
1 parent f936f35 commit e3b1f81

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

output_generators/terminal.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ function inputToUrl(testCase) {
4343
/**
4444
* Format and print a test result to the terminal.
4545
*/
46-
function prettyPrintTestCase( testCase, quiet ){
46+
function prettyPrintTestCase( testCase, quiet, index ){
4747
var result = testSuiteHelpers.getMainResult(testCase);
48-
var id = result.testCase.id;
48+
var id = result.testCase.id || index;
4949
delete result.testCase.in.api_key; // don't display API key
5050

5151
const query = inputToUrl(testCase);
@@ -110,8 +110,8 @@ function prettyPrintSuiteResults( suiteResults, config, testSuites ){
110110
console.log();
111111
console.log(testSuite.name.blue);
112112

113-
testSuite.tests.forEach( function(testCase) {
114-
prettyPrintTestCase( testCase, config.quiet );
113+
testSuite.tests.forEach( function(testCase, index) {
114+
prettyPrintTestCase( testCase, config.quiet, index );
115115
});
116116
}
117117
});

0 commit comments

Comments
 (0)