Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 4b053eb

Browse files
eddiemongejuliemr
authored andcommitted
fix(runner): only run selenium with spec files
Only setup Selenium if there are actual spec files passed in
1 parent 154ecf7 commit 4b053eb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/runner.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,6 @@ var runTests = function() {
219219
'since Protractor 0.6.0. Please switch to config.specs.');
220220
}
221221
var specs = config.specs;
222-
if (!specs || specs.length == 0) {
223-
throw new Error('No spec files found.');
224-
}
225222
var resolvedSpecs = [];
226223
for (var i = 0; i < specs.length; ++i) {
227224
var matches = glob.sync(specs[i], {cwd: config.configDir});
@@ -361,6 +358,12 @@ var runTests = function() {
361358
* Run Protractor once.
362359
*/
363360
var runOnce = function() {
361+
var specs = config.specs;
362+
if (!specs || specs.length === 0) {
363+
util.puts('No spec files found');
364+
process.exit(0);
365+
}
366+
364367
return setUpSelenium().then(function() {
365368
// cleanUp must be registered directly onto runTests, not onto
366369
// the chained promise, so that cleanUp is still called in case of a

0 commit comments

Comments
 (0)