Skip to content

Commit

Permalink
Merge pull request #190 from pelias/handle-no-tests
Browse files Browse the repository at this point in the history
fix: Handle case where no tests are present
  • Loading branch information
orangejulius authored May 5, 2020
2 parents 0b6ee14 + c67c1b0 commit 3c3d447
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/request_urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ function request_urls(config, urls, callback) {

var getOneUrl = function (){
if( urls.length === 0 ){
return;
clearInterval(intervalId);
return callback([]);
}

var url = urls.pop();
Expand Down
5 changes: 5 additions & 0 deletions output_generators/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ function shouldDisplayTestSuite(testSuite) {
* Format and print all of the results from any number of test-suites.
*/
function prettyPrintSuiteResults( suiteResults, config, testSuites ){
if (testSuites.length === 0) {
console.log('No tests found. Place test definitions in the `test_cases` directory');
return 0;
}

console.log( 'Tests for:', config.endpoint.url.blue + ' (' + config.endpoint.name.blue + ')' );

testSuites.forEach( function(testSuite) {
Expand Down

0 comments on commit 3c3d447

Please sign in to comment.