Skip to content

Commit

Permalink
test: fix tests for getRemoteUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans committed Nov 22, 2022
1 parent ff7e3fe commit 9c41f91
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions __test__/utils.unit.test.ts
Expand Up @@ -90,11 +90,28 @@ describe('utils tests', () => {
})

test('getRemoteUrl successfully returns remote URLs', async () => {
const url1 = utils.getRemoteUrl('HTTPS', 'peter-evans/create-pull-request')
const url1 = utils.getRemoteUrl(
'HTTPS',
'github.com',
'peter-evans/create-pull-request'
)
expect(url1).toEqual('https://github.com/peter-evans/create-pull-request')

const url2 = utils.getRemoteUrl('SSH', 'peter-evans/create-pull-request')
const url2 = utils.getRemoteUrl(
'SSH',
'github.com',
'peter-evans/create-pull-request'
)
expect(url2).toEqual('git@github.com:peter-evans/create-pull-request.git')

const url3 = utils.getRemoteUrl(
'HTTPS',
'mygithubserver.com',
'peter-evans/create-pull-request'
)
expect(url3).toEqual(
'https://mygithubserver.com/peter-evans/create-pull-request'
)
})

test('secondsSinceEpoch returns the number of seconds since the Epoch', async () => {
Expand Down

0 comments on commit 9c41f91

Please sign in to comment.