diff --git a/lib/runner.js b/lib/runner.js index 1a640ae37..5512a2508 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -219,9 +219,6 @@ var runTests = function() { 'since Protractor 0.6.0. Please switch to config.specs.'); } var specs = config.specs; - if (!specs || specs.length == 0) { - throw new Error('No spec files found.'); - } var resolvedSpecs = []; for (var i = 0; i < specs.length; ++i) { var matches = glob.sync(specs[i], {cwd: config.configDir}); @@ -361,6 +358,12 @@ var runTests = function() { * Run Protractor once. */ var runOnce = function() { + var specs = config.specs; + if (!specs || specs.length === 0) { + util.puts('No spec files found'); + process.exit(0); + } + return setUpSelenium().then(function() { // cleanUp must be registered directly onto runTests, not onto // the chained promise, so that cleanUp is still called in case of a