mirror of
https://code.forgejo.org/actions/checkout.git
synced 2024-11-22 18:41:15 +01:00
added tests
Signed-off-by: James Bradlee <james.bradlee@telenor.no>
This commit is contained in:
parent
267ca9cee1
commit
3a6c8fb5e6
1 changed files with 22 additions and 0 deletions
|
@ -144,4 +144,26 @@ describe('input-helper tests', () => {
|
||||||
const settings: IGitSourceSettings = await inputHelper.getInputs()
|
const settings: IGitSourceSettings = await inputHelper.getInputs()
|
||||||
expect(settings.workflowOrganizationId).toBe(123456)
|
expect(settings.workflowOrganizationId).toBe(123456)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('accepts ref and commit', async () => {
|
||||||
|
inputs.ref = 'refs/pull/123/merge'
|
||||||
|
inputs.commit = '0123456789012345678901234567890123456789'
|
||||||
|
const settings: IGitSourceSettings = await inputHelper.getInputs()
|
||||||
|
expect(settings).toBeTruthy()
|
||||||
|
expect(settings.ref).toBeTruthy()
|
||||||
|
expect(settings.ref).toStrictEqual('refs/pull/123/merge')
|
||||||
|
expect(settings.commit).toBeTruthy()
|
||||||
|
expect(settings.commit).toStrictEqual('0123456789012345678901234567890123456789')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('ref fallbacks to commit if ref is empty but commit is specified', async () => {
|
||||||
|
inputs.ref = ''
|
||||||
|
inputs.commit = '0123456789012345678901234567890123456789'
|
||||||
|
const settings: IGitSourceSettings = await inputHelper.getInputs()
|
||||||
|
expect(settings).toBeTruthy()
|
||||||
|
expect(settings.ref).toBeTruthy()
|
||||||
|
expect(settings.ref).toStrictEqual('0123456789012345678901234567890123456789')
|
||||||
|
expect(settings.commit).toBeTruthy()
|
||||||
|
expect(settings.commit).toStrictEqual('0123456789012345678901234567890123456789')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue