diff options
| author | eric sciple <ericsciple@users.noreply.github.com> | 2020-01-21 14:17:04 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-21 14:17:04 -0500 |
| commit | 12bd1637c11cfa549d99e323740931f7481924d7 (patch) | |
| tree | dd6867ece1cf77c75e956bbfe52cb1efbccef21f /__test__/input-helper.test.ts | |
| parent | 7ca3468192f1fa956e1fcc853baedb79587fe236 (diff) | |
fix ref for pr closed event when a pr is merged (#141)
Diffstat (limited to '__test__/input-helper.test.ts')
| -rw-r--r-- | __test__/input-helper.test.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/__test__/input-helper.test.ts b/__test__/input-helper.test.ts index ecd3cd1..778c6eb 100644 --- a/__test__/input-helper.test.ts +++ b/__test__/input-helper.test.ts @@ -75,6 +75,20 @@ describe('input-helper tests', () => { expect(settings.repositoryPath).toBe(gitHubWorkspace) }) + it('qualifies ref', () => { + let originalContext = mockGitHub.context + try { + mockGitHub.context = {...originalContext} // Shallow clone + mockGitHub.context.ref = 'some-unqualified-ref' + const settings: ISourceSettings = inputHelper.getInputs() + expect(settings).toBeTruthy() + expect(settings.commit).toBe('1234567890123456789012345678901234567890') + expect(settings.ref).toBe('refs/heads/some-unqualified-ref') + } finally { + mockGitHub.context = originalContext + } + }) + it('requires qualified repo', () => { inputs.repository = 'some-unqualified-repo' assert.throws(() => { |
