Skip to content

Commit

Permalink
Fix: ignore empty path in patterns (fixes #8362) (#8364)
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto committed Mar 30, 2017
1 parent 27616a8 commit 155424c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/glob-util.js
Expand Up @@ -86,7 +86,7 @@ function resolveFileGlobPatterns(patterns, options) {

const processPathExtensions = processPath(options);

return patterns.map(processPathExtensions);
return patterns.filter(p => p.length).map(processPathExtensions);
}

/**
Expand Down
10 changes: 10 additions & 0 deletions tests/lib/util/glob-util.js
Expand Up @@ -144,6 +144,16 @@ describe("globUtil", () => {
assert.deepEqual(result, ["one-js-file/example.js"]);
});

it("should ignore empty patterns", () => {
const patterns = [""];
const opts = {
cwd: getFixturePath()
};
const result = globUtil.resolveFileGlobPatterns(patterns, opts);

assert.deepEqual(result, []);
});

});

describe("listFilesToProcess()", () => {
Expand Down

0 comments on commit 155424c

Please sign in to comment.