Skip to content

Commit

Permalink
Clean up mock data setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
febuiles committed Aug 18, 2022
1 parent 54af7c7 commit d201842
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions __tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ function setInput(input: string, value: string) {
// We want a clean ENV before each test. We use `delete`
// since we want `undefined` values and not empty strings.
function clearInputs() {
delete process.env['INPUT_FAIL-ON-SEVERITY']
delete process.env['INPUT_ALLOW-LICENSES']
delete process.env['INPUT_DENY-LICENSES']
delete process.env['INPUT_BASE-REF']
delete process.env['INPUT_HEAD-REF']
const allowedOptions = [
'FAIL-ON-SEVERITY',
'ALLOW-LICENSES',
'DENY-LICENSES',
'BASE-REF',
'HEAD-REF'
]

allowedOptions.forEach(option => {
delete process.env[`INPUT_${option.toUpperCase()}`]
})
}

beforeEach(() => {
Expand Down

0 comments on commit d201842

Please sign in to comment.