mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-21 17:12:03 +03:00
enbl-4519 updating code to use relative paths that are parent paths of the workspace
This commit is contained in:
parent
25a956c84d
commit
e6a424882a
8 changed files with 13062 additions and 12835 deletions
|
@ -110,6 +110,29 @@ describe('input-helper tests', () => {
|
|||
)
|
||||
})
|
||||
|
||||
it('parent path failure', () => {
|
||||
inputs.path = '../../testdir'
|
||||
|
||||
try {
|
||||
let test = inputHelper.getInputs()
|
||||
assert.fail("Test should have thrown an exception")
|
||||
} catch {
|
||||
// empty, if it throws its good
|
||||
}
|
||||
})
|
||||
|
||||
it('parent path success', () => {
|
||||
inputs.path = '../../testdir'
|
||||
inputs.allow_parent_path = true
|
||||
|
||||
const settings: IGitSourceSettings = inputHelper.getInputs()
|
||||
|
||||
expect(settings.repositoryPath).toBe(
|
||||
path.join(gitHubWorkspace, '..', '..', 'testdir')
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
it('sets ref to empty when explicit sha', () => {
|
||||
inputs.ref = '1111111111222222222233333333334444444444'
|
||||
const settings: IGitSourceSettings = inputHelper.getInputs()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue