1
0
Fork 0
toolkit/packages/oidc-client/__tests__/main.test.ts

21 lines
610 B
TypeScript
Raw Normal View History

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