fix: enable-url-completion input treating the string "false" as true (#307)
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:
Yuta Kasai
2025-03-31 19:22:50 +09:00
committed by GitHub
parent d40710dfb0
commit 0505d8b048
5 changed files with 36 additions and 13 deletions

View 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)
})
})