Skip to content

Commit 3c3d447

Browse files
authored
Merge pull request #190 from pelias/handle-no-tests
fix: Handle case where no tests are present
2 parents 0b6ee14 + c67c1b0 commit 3c3d447

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/request_urls.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function request_urls(config, urls, callback) {
3838

3939
var getOneUrl = function (){
4040
if( urls.length === 0 ){
41-
return;
41+
clearInterval(intervalId);
42+
return callback([]);
4243
}
4344

4445
var url = urls.pop();

output_generators/terminal.js

+5
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ function shouldDisplayTestSuite(testSuite) {
102102
* Format and print all of the results from any number of test-suites.
103103
*/
104104
function prettyPrintSuiteResults( suiteResults, config, testSuites ){
105+
if (testSuites.length === 0) {
106+
console.log('No tests found. Place test definitions in the `test_cases` directory');
107+
return 0;
108+
}
109+
105110
console.log( 'Tests for:', config.endpoint.url.blue + ' (' + config.endpoint.name.blue + ')' );
106111

107112
testSuites.forEach( function(testSuite) {

0 commit comments

Comments
 (0)