Skip to content

Commit

Permalink
Close #260 PR: Ignore possible test files under node_modules folder. F…
Browse files Browse the repository at this point in the history
…ixes #226.. Fixes #226
  • Loading branch information
Juan Soto authored and sindresorhus committed Nov 24, 2015
1 parent ffb750b commit a4f8e24
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
!test/fixture/node_modules
.nyc_output
coverage
2 changes: 2 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ function handlePaths(files) {
];
}

files.push('!**/node_modules/**');

// convert pinkie-promise to Bluebird promise
files = Promise.resolve(globby(files));

Expand Down
8 changes: 8 additions & 0 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,11 @@ test('test file that immediately exits with 0 exit code ', function (t) {
t.end();
});
});

test('test file in node_modules is ignored', function (t) {
execCli('fixture/node_modules/test.js', function (err, stdout, stderr) {
t.ok(err);
t.true(/Couldn't find any files to test/.test(stderr));
t.end();
});
});
6 changes: 6 additions & 0 deletions test/fixture/node_modules/test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a4f8e24

Please sign in to comment.