Files
shields/services/opm/opm-version.tester.js
2021-07-09 12:53:55 +01:00

21 lines
569 B
JavaScript

import Joi from 'joi'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
const isValidVersion = Joi.string()
.regex(/^v[\d+.]+$/)
.required()
t.create('version').get('/openresty/lua-resty-lrucache.json').expectBadge({
label: 'opm',
message: isValidVersion,
})
t.create('unknown module')
.get('/openresty/does-not-exist.json')
.expectBadge({ label: 'opm', message: 'module not found' })
t.create('unknown user')
.get('/nil/does-not-exist.json')
.expectBadge({ label: 'opm', message: 'module not found' })