mirror of
https://github.com/actions/checkout.git
synced 2025-04-20 01:26:46 +00:00
second attempt
This commit is contained in:
parent
e8e821983d
commit
df4b58c789
2 changed files with 60 additions and 8 deletions
23
__test__/url-helper.test.ts
Normal file
23
__test__/url-helper.test.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import * as urlHelper from '../src/url-helper'
|
||||
|
||||
describe('isGhes tests', () => {
|
||||
it('basics', async () => {
|
||||
expect(urlHelper.isGhes()).toBeFalsy()
|
||||
expect(urlHelper.isGhes('https://github.com')).toBeFalsy()
|
||||
//expect(urlHelper.isGhes('https://api.github.com')).toBeFalsy()
|
||||
expect(urlHelper.isGhes('https://europe.ghe.com')).toBeFalsy()
|
||||
expect(urlHelper.isGhes('https://test.github.localhost')).toBeFalsy()
|
||||
expect(urlHelper.isGhes('https://src.onpremise.customer.com')).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
||||
describe('getServerApiUrl tests', () => {
|
||||
it('basics', async () => {
|
||||
expect(urlHelper.getServerApiUrl()).toBe('https://api.github.com')
|
||||
expect(urlHelper.getServerApiUrl('https://github.com')).toBe('https://api.github.com')
|
||||
expect(urlHelper.getServerApiUrl('https://GitHub.com')).toBe('https://api.github.com')
|
||||
expect(urlHelper.getServerApiUrl('https://europe.ghe.com')).toBe('https://api.europe.ghe.com')
|
||||
expect(urlHelper.getServerApiUrl('https://australia.GHE.COM')).toBe('https://api.australia.ghe.com')
|
||||
expect(urlHelper.getServerApiUrl('https://src.onpremise.customer.com')).toBe('https://src.onpremise.customer.com/api/v3')
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue