Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export async function main(
let coverageFilePaths: string[] = []
if (args.file !== undefined) {
if (typeof args.file === 'string') {
requestedPaths = [args.file]
requestedPaths = args.file.split(',')
} else {
requestedPaths = args.file // Already an array
}
Expand Down
25 changes: 25 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,31 @@ describe('Uploader Core', () => {
)
})

it('Can find multiple specified files as comma-separated', async () => {
const log = jest.spyOn(console, 'log').mockImplementation(() => {
// intentionally empty
})
await app.main({
dryRun: 'true',
file: 'test/fixtures/coverage.txt,test/fixtures/other/coverage.txt,test/does/not/exist.txt',
name: 'customname',
token: 'abcdefg',
url: 'https://codecov.io',
flags: '',
slug: '',
upstream: ''
})
expect(log).toHaveBeenCalledWith(
expect.stringMatching(/Processing.*test\/fixtures\/coverage\.txt\.\.\./),
)
expect(log).toHaveBeenCalledWith(
expect.stringMatching(/Processing.*test\/fixtures\/other\/coverage\.txt\.\.\./),
)
expect(log).not.toHaveBeenCalledWith(
expect.stringMatching(/Processing.*test\/does\/not\/exist\.txt\.\.\./),
)
})

it('will process blocked files, if passed via -f', async () => {
const log = jest.spyOn(console, 'log').mockImplementation(() => {
// intentionally empty
Expand Down