mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-08 10:01:34 +00:00
filter out shared from yaml anchor output
This commit is contained in:
parent
de90cc6fb3
commit
9f68be011c
2 changed files with 16 additions and 2 deletions
|
@ -1,5 +1,15 @@
|
|||
import * as core from '@actions/core'
|
||||
import {Filter, FilterConfig, PredicateQuantifier} from '../src/filter'
|
||||
import {File, ChangeStatus} from '../src/file'
|
||||
import {exportResults} from '../src/main'
|
||||
|
||||
jest.mock('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
startGroup: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
endGroup: jest.fn()
|
||||
}))
|
||||
|
||||
describe('yaml filter parsing tests', () => {
|
||||
test('throws if yaml is not a dictionary', () => {
|
||||
|
@ -160,6 +170,9 @@ describe('matching tests', () => {
|
|||
const filter = new Filter(yaml)
|
||||
const files = modified(['config/settings.yml'])
|
||||
const match = filter.match(files)
|
||||
exportResults(match, 'none')
|
||||
|
||||
expect(core.setOutput).toHaveBeenCalledWith('changes', '["src"]')
|
||||
expect(match.src).toEqual(files)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue