//native
type Circleci = {
token: string
}
/**
* Get test metadata
* Get test metadata for a build. In the rare case where there is more than 250MB of test data on the job, no results will be returned.
*/
export async function main(auth: Circleci, job_number: string, project_slug: string) {
const url = new URL(`https://circleci.com/api/v2/project/${project_slug}/${job_number}/tests`)
const response = await fetch(url, {
method: 'GET',
headers: {
'Circle-Token': auth.token
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 537 days ago