From a24eeee4f08e973ffcecd107b6610ce1c2c5e3f6 Mon Sep 17 00:00:00 2001 From: Julie Date: Thu, 21 Nov 2013 16:29:34 -0800 Subject: [PATCH] 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 --- lib/runner.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/runner.js b/lib/runner.js index 7cdaaa702..758bcfbe4 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -181,12 +181,15 @@ var runJasmineTests = function() { for (var i = 0; i < specs.length; ++i) { var matches = glob.sync(specs[i], {cwd: config.specFileBase}); if (!matches.length) { - throw new Error('Test file ' + specs[i] + ' did not match any files.'); + util.puts('Warning: pattern ' + specs[i] + ' did not match any files.'); } for (var j = 0; j < matches.length; ++j) { resolvedSpecs.push(path.resolve(config.specFileBase, matches[j])); } } + if (!resolvedSpecs.length) { + throw new Error('Spec patterns did not match any files.'); + } minijn.addSpecs(resolvedSpecs); // TODO: This should not be tied to the webdriver promise loop, it should use