Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Fix broken gcov command #173

Merged
merged 1 commit into from
Sep 9, 2020
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
3 changes: 3 additions & 0 deletions lib/codecov.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,9 @@ var upload = function(args, on_success, on_failure) {
}

function sanitizeVar(arg) {
if (!arg) {
return ''
}
return arg.replace(/&/g, '')
}

Expand Down
6 changes: 6 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,10 @@ describe('Codecov', function() {
'real run unsafe command'
)
})

it('gracefully sanitizes undefined', function() {
expect(function() {
codecov.sanitizeVar(undefined)
}).not.toThrow()
})
})