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

Commit

Permalink
Merge pull request #173 from ptomato/fix-gcov-command
Browse files Browse the repository at this point in the history
Fix broken gcov command
  • Loading branch information
thomasrockhu committed Sep 9, 2020
2 parents 7d9af78 + 764a681 commit e737099
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/codecov.js
Expand Up @@ -577,6 +577,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
Expand Up @@ -294,4 +294,10 @@ describe('Codecov', function() {
'real run unsafe command'
)
})

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

0 comments on commit e737099

Please sign in to comment.