mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-07 16:49:03 +00:00
Use micromatch instead of minimatch (#46)
* Use micromatch instead of minimatch micromatch claims to support full Bash 4.3 spec and it actually passes all the tests. For example this fixes processing of '!(**/*.tsx|**/*.less)' pattern - needed by #45 * Update CHANGELOG.md
This commit is contained in:
parent
7b5334ddb5
commit
b37d4e9e86
7 changed files with 4413 additions and 1355 deletions
|
@ -98,6 +98,25 @@ describe('matching tests', () => {
|
|||
expect(match.dot).toEqual(files)
|
||||
})
|
||||
|
||||
test('matches all except tsx and less files (negate a group with or-ed parts)', () => {
|
||||
const yaml = `
|
||||
backend:
|
||||
- '!(**/*.tsx|**/*.less)'
|
||||
`
|
||||
const filter = new Filter(yaml)
|
||||
const tsxFiles = modified(['src/ui.tsx'])
|
||||
const lessFiles = modified(['src/ui.less'])
|
||||
const pyFiles = modified(['src/server.py'])
|
||||
|
||||
const tsxMatch = filter.match(tsxFiles)
|
||||
const lessMatch = filter.match(lessFiles)
|
||||
const pyMatch = filter.match(pyFiles)
|
||||
|
||||
expect(tsxMatch.backend).toEqual([])
|
||||
expect(lessMatch.backend).toEqual([])
|
||||
expect(pyMatch.backend).toEqual(pyFiles)
|
||||
})
|
||||
|
||||
test('matches path based on rules included using YAML anchor', () => {
|
||||
const yaml = `
|
||||
shared: &shared
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue