Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Ignore files starting with a "." (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert authored May 17, 2019
1 parent db6da80 commit 9ff562f
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 77 deletions.
128 changes: 54 additions & 74 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"jest": "^24.8.0",
"lint-staged": "^8.1.7",
"prettier": "^1.17.1",
"rollup": "^1.12.0",
"rollup": "^1.12.1",
"rollup-plugin-typescript": "^1.0.1",
"shx": "^0.3.2",
"ts-jest": "^24.0.2",
Expand Down
3 changes: 2 additions & 1 deletion src/createFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const createFilter: CreateFilter = function createFilter(include?, exclude?, opt
test: mm.matcher(
getMatcherString(id, resolutionBase)
.split(sep)
.join('/')
.join('/'),
{ dot: true }
)
};
};
Expand Down
7 changes: 6 additions & 1 deletion test/createFilter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,17 @@ describe('createFilter', function() {

it('allows preventing resolution against process.cwd()', () => {
const filter = createFilter(['y*'], ['yx'], { resolve: false });
const basePath = path.resolve('C/d');
expect(filter('x')).toBeFalsy();
expect(filter('ys')).toBeTruthy();
expect(filter('yx')).toBeFalsy();
expect(filter(path.resolve('C') + '/ys')).toBeFalsy();
expect(filter(path.resolve('C/d/ys'))).toBeFalsy();
expect(filter(path.resolve('ys'))).toBeFalsy();
});

it('includes names starting with a "."', () => {
const filter = createFilter(['**/*a']);
expect(filter(path.resolve('.a'))).toBeTruthy();
expect(filter(path.resolve('.x/a'))).toBeTruthy();
});
});

0 comments on commit 9ff562f

Please sign in to comment.