ensure subject globs match only files (#54)

Signed-off-by: Brian DeHamer <[email protected]>
This commit is contained in:
Brian DeHamer
2024-05-06 11:52:03 -07:00
committed by GitHub
parent c58d52c41d
commit d442d85e12
3 changed files with 22 additions and 0 deletions
+13
View File
@@ -203,6 +203,19 @@ describe('subjectFromInputs', () => {
})
})
describe('when a file glob is supplied which also matches non-files', () => {
beforeEach(async () => {
process.env['INPUT_SUBJECT-PATH'] = `${dir}*`
})
it('returns the subjects (excluding non-files)', async () => {
const subjects = await subjectFromInputs()
expect(subjects).toBeDefined()
expect(subjects).toHaveLength(7)
})
})
describe('when a comma-separated list is supplied', () => {
beforeEach(async () => {
process.env['INPUT_SUBJECT-PATH'] =