mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-08 18:09:04 +00:00
Adds global filter option
This commit is contained in:
parent
9a3e560c61
commit
14827485d3
7 changed files with 83 additions and 20 deletions
|
@ -192,6 +192,26 @@ describe('matching specific change status', () => {
|
|||
const match = filter.match(files)
|
||||
expect(match.ignore).toEqual(modified(['config/settings.yml']))
|
||||
})
|
||||
test('matches path based on rules including using global ignore', () => {
|
||||
const yaml = `
|
||||
ignore:
|
||||
-
|
||||
paths: ["**/*"]
|
||||
paths_ignore:
|
||||
- "**.md"
|
||||
ignoreall:
|
||||
-
|
||||
paths: ["**/*"]
|
||||
paths_ignore:
|
||||
- "**.md"
|
||||
- "**.yml"
|
||||
`
|
||||
const filter = new Filter(yaml, ['**.this'])
|
||||
const files = modified(['config/settings.yml', 'config/settings.md', 'nothing/todo/with.this'])
|
||||
const match = filter.match(files)
|
||||
expect(match.ignore).toEqual(modified(['config/settings.yml']))
|
||||
expect(match.ignoreall).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
function modified(paths: string[]): File[] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue