fix: enable-url-completion input treating the string "false" as true (#307)
Some checks failed
Publish Docker Image / publish (push) Has been cancelled
Some checks failed
Publish Docker Image / publish (push) Has been cancelled
* NO-ISSUE Add test * NO-ISSUE Use core.getBooleanInput() to retrieve boolean input values * NO-ISSUE npm run build * NO-ISSUE Delete unused import
This commit is contained in:
28
__test__/input-helper.unit.test.ts
Normal file
28
__test__/input-helper.unit.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import {getInputs} from '../src/input-helper'
|
||||
|
||||
describe('input-helper tests', () => {
|
||||
const ORIGINAL_ENV = process.env
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetModules()
|
||||
process.env = {...ORIGINAL_ENV}
|
||||
})
|
||||
|
||||
afterAll(() => {
|
||||
process.env = ORIGINAL_ENV
|
||||
})
|
||||
|
||||
test('enableUrlCompletion should be false when "false" is passed', () => {
|
||||
process.env['INPUT_ENABLE-URL-COMPLETION'] = 'false'
|
||||
|
||||
const inputs = getInputs()
|
||||
expect(inputs.enableUrlCompletion).toBe(false)
|
||||
})
|
||||
|
||||
test('enableUrlCompletion should be true when "true" is passed', () => {
|
||||
process.env['INPUT_ENABLE-URL-COMPLETION'] = 'true'
|
||||
|
||||
const inputs = getInputs()
|
||||
expect(inputs.enableUrlCompletion).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user