buster-glob
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -16,6 +16,11 @@ var B = require("buster-core"); | ||
function resolveGlobs(patterns, options) { | ||
options = options || {}; | ||
return array(patterns).reduce(function (fns, pattern) { | ||
fns.push(function (done) { | ||
glob(pattern, options, function (err, matches) { | ||
done(err, matches); | ||
if (!err && options.strict && matches.length === 0) { | ||
done(new Error("'" + pattern + "' matched no files")); | ||
} else { | ||
done(err, matches); | ||
} | ||
}); | ||
@@ -22,0 +27,0 @@ }); |
{ | ||
"name": "buster-glob", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Small wrapper around the glob module that allows globbing for multiple patterns at once", | ||
@@ -22,3 +22,3 @@ "homepage": "http://busterjs.org/buster-glob", | ||
"glob": ">=3.0", | ||
"buster-core": ">=0.5.1" | ||
"buster-core": ">=0.6.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "devDependencies": { |
@@ -96,3 +96,16 @@ var buster = require("buster"); | ||
assert.calledWith(callback, null, ["src/foo.js", "src/bar.js"]); | ||
}, | ||
"strict": { | ||
"fails on glob that matches no patterns": function () { | ||
var callback = this.spy(); | ||
glob.glob.withArgs("src/foo.js").yields(null, []); | ||
g.glob(["src/foo.js"], { strict: true }, callback); | ||
assert.match(callback.args[0][0], { | ||
message: "'src/foo.js' matched no files" | ||
}); | ||
} | ||
} | ||
}); |
5868
147
Updatedbuster-core@>=0.6.0