mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-08 18:09:04 +00:00
Adds ignore path functionality
This commit is contained in:
parent
b0bc141e31
commit
d748e34e85
10 changed files with 9748 additions and 32251 deletions
|
@ -179,6 +179,19 @@ describe('matching specific change status', () => {
|
|||
const match = filter.match(files)
|
||||
expect(match.src).toEqual(files)
|
||||
})
|
||||
test('matches path based on rules including using ignore', () => {
|
||||
const yaml = `
|
||||
ignore:
|
||||
-
|
||||
paths: ["config/**"]
|
||||
paths_ignore:
|
||||
- "**.md"
|
||||
`
|
||||
const filter = new Filter(yaml)
|
||||
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']))
|
||||
})
|
||||
})
|
||||
|
||||
function modified(paths: string[]): File[] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue