Skip to content

Commit

Permalink
Merge pull request #104 from fidian/extglob-tests
Browse files Browse the repository at this point in the history
Adding additional tests
  • Loading branch information
jonschlinkert committed Sep 8, 2017
2 parents 12e9d37 + ba5347b commit caa77dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -15,7 +15,8 @@
"Martin Kolárik (https://kolarik.sk)",
"Paul Miller (paulmillr.com)",
"Tom Byrer (https://github.com/tomByrer)",
"(https://github.com/DianeLooney)"
"(https://github.com/DianeLooney)",
"Tyler Akins <fidian@rumkin.com> (http://rumkin.com)"
],
"repository": "micromatch/micromatch",
"bugs": {
Expand Down
7 changes: 7 additions & 0 deletions test/extglobs.js
Expand Up @@ -49,6 +49,13 @@ describe('extglobs', function() {
mm(['a.js', 'a.txt', 'a.md'], 'a.!(js)*', ['a.md', 'a.txt']);
});

it('handles extglobs and patterns, issues 100, 102, 103', function() {
mm(['foo/MyDir/MyFile.jsx'], 'foo/MyDir/**/*.+(js|jsx)', ['foo/MyDir/MyFile.jsx']);
mm(['file.txt'], '**/!(folder).txt', ['file.txt']);
mm(['a/dir/file.txt'], '*/dir/**/!(folder).txt', ['a/dir/file.txt']);
mm(['a/b/c.txt', 'a/b/cc.txt'], '*/b/!(c).txt', ['a/b/cc.txt']);
});

it('should support negation', function() {
var arr = ['a', 'b', 'aa', 'ab', 'bb', 'ac', 'aaa', 'aab', 'abb', 'ccc'];
mm(arr, '!(a)*', ['b', 'bb', 'ccc']);
Expand Down

0 comments on commit caa77dc

Please sign in to comment.