Files
toolkit/packages/oidc-client/__tests__/main.test.ts
T

21 lines
610 B
TypeScript
Raw Normal View History

2021-07-20 08:58:34 +05:30
import {getIDTokenUrl} from './../src/internal/config-variables'
2021-07-01 08:11:28 +05:30
import {HttpClient} from '@actions/http-client'
test('Get httpclient', () => {
2021-07-20 08:58:34 +05:30
const http = new HttpClient('actions/oidc-client')
2021-07-01 08:11:28 +05:30
expect(http).toBeDefined()
})
test('HTTP get request to get token endpoint', async () => {
2021-07-20 08:58:34 +05:30
const http = new HttpClient('actions/oidc-client')
const res = await http.get(
2021-07-01 08:11:28 +05:30
'https://ghactionsoidc.azurewebsites.net/.well-known/openid-configuration'
)
expect(res.message.statusCode).toBe(200)
})
test('Get token endpoint', async () => {
2021-07-20 08:58:34 +05:30
let url; url = getIDTokenUrl()
2021-07-01 08:11:28 +05:30
expect(url).toBeDefined()
})