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

Commit a24eeee

Browse files
committed
fix(runner): do not error out if only one spec pattern does not match any files
Previously, the runner would throw an error if any one of the spec patterns did not match any files. Now it logs a warning in that case, and errors out only if there are no found files in any spec patterns. Closes #260
1 parent 579bcc4 commit a24eeee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/runner.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,15 @@ var runJasmineTests = function() {
181181
for (var i = 0; i < specs.length; ++i) {
182182
var matches = glob.sync(specs[i], {cwd: config.specFileBase});
183183
if (!matches.length) {
184-
throw new Error('Test file ' + specs[i] + ' did not match any files.');
184+
util.puts('Warning: pattern ' + specs[i] + ' did not match any files.');
185185
}
186186
for (var j = 0; j < matches.length; ++j) {
187187
resolvedSpecs.push(path.resolve(config.specFileBase, matches[j]));
188188
}
189189
}
190+
if (!resolvedSpecs.length) {
191+
throw new Error('Spec patterns did not match any files.');
192+
}
190193

191194
minijn.addSpecs(resolvedSpecs);
192195
// TODO: This should not be tied to the webdriver promise loop, it should use

0 commit comments

Comments
 (0)