Files
shields/services/docsrs/docsrs.tester.js
Nemo157 3dc56134d9 Use the latest build status when checking docs.rs (#7613)
When documentation for a crate is rebuilt the `builds.json` can return
multiple results, ordered latest first, so we must take the first
element of the array rather than the last.

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-02-20 01:15:40 +00:00

23 lines
651 B
JavaScript

import Joi from 'joi'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('Passing docs')
.get('/tokio/0.3.0.json')
.expectBadge({ label: 'docs@0.3.0', message: 'passing' })
t.create('Failing docs')
.get('/tensorflow/0.16.1.json')
.expectBadge({ label: 'docs@0.16.1', message: 'failing' })
t.create('Multiple builds, latest passing')
.get('/bevy_tweening/0.3.1.json')
.expectBadge({ label: 'docs@0.3.1', message: 'passing' })
t.create('Getting latest version works')
.get('/rand/latest.json')
.expectBadge({
label: 'docs',
message: Joi.allow('passing', 'failing'),
})