Skip to content

Commit

Permalink
Share glob caches (#1661)
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn authored and sindresorhus committed Jan 29, 2018
1 parent b6fa8b9 commit a84c96f
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions lib/ava-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,33 +122,31 @@ class AvaFiles {
this.files = files;
this.sources = options.sources || [];
this.cwd = options.cwd || process.cwd();
this.globCaches = {
cache: Object.create(null),
statCache: Object.create(null),
realpathCache: Object.create(null),
symlinks: Object.create(null)
};

autoBind(this);
}

findTestFiles() {
return handlePaths(this.files, this.excludePatterns, {
return handlePaths(this.files, this.excludePatterns, Object.assign({
cwd: this.cwd,
cache: Object.create(null),
statCache: Object.create(null),
realpathCache: Object.create(null),
symlinks: Object.create(null),
expandDirectories: false,
nodir: false
});
}, this.globCaches));
}

findTestHelpers() {
return handlePaths(defaultHelperPatterns(), ['!**/node_modules/**'], {
return handlePaths(defaultHelperPatterns(), ['!**/node_modules/**'], Object.assign({
cwd: this.cwd,
includeUnderscoredFiles: true,
cache: Object.create(null),
statCache: Object.create(null),
realpathCache: Object.create(null),
symlinks: Object.create(null),
expandDirectories: false,
nodir: false
});
}, this.globCaches));
}

isSource(filePath) {
Expand Down

0 comments on commit a84c96f

Please sign in to comment.