Files
shields/services/luarocks/luarocks.tester.js
T
Paul MelnikowandGitHub 7a664ca3e8 Run prettier (#1866)
Merging this separately so the commit with the tooling change is readable. This is a follow-on to #1167 which turned prettier on.
2018-08-08 17:57:14 -04:00

28 lines
666 B
JavaScript

'use strict'
const Joi = require('joi')
const ServiceTester = require('../service-tester')
const t = new ServiceTester({ id: 'luarocks', title: 'LuaRocks' })
module.exports = t
const isLuaVersion = Joi.string().regex(/^v\d+\.\d+\.\d+-\d+$/)
t.create('version')
.get('/v/mpeterv/luacheck.json')
.expectJSONTypes(
Joi.object().keys({
name: 'luarocks',
value: isLuaVersion,
})
)
t.create('unknown package')
.get('/v/nil/does-not-exist.json')
.expectJSON({ name: 'luarocks', value: 'invalid' })
t.create('connection error')
.get('/v/mpeterv/luacheck.json')
.networkOff()
.expectJSON({ name: 'luarocks', value: 'inaccessible' })