diff --git a/package.json b/package.json index df074250..77f58c21 100644 --- a/package.json +++ b/package.json @@ -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 (http://rumkin.com)" ], "repository": "micromatch/micromatch", "bugs": { diff --git a/test/extglobs.js b/test/extglobs.js index 62c0cc87..6c27a82c 100644 --- a/test/extglobs.js +++ b/test/extglobs.js @@ -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']);