Migrated most service tests to use new expectBadge (#3122)

This commit is contained in:
Pierre-Yves B
2019-02-28 21:43:23 +00:00
committed by GitHub
parent 4e2d144f97
commit 1f29c22d3d
230 changed files with 3480 additions and 4439 deletions

View File

@@ -1,30 +1,25 @@
'use strict'
const Joi = require('joi')
const { isVPlusTripleDottedVersion } = require('../test-validators')
const t = (module.exports = require('../tester').createServiceTester())
t.create('package version')
.get('/v/box2d.json')
.expectJSONTypes(
Joi.object().keys({
name: 'pub',
value: isVPlusTripleDottedVersion,
})
)
.expectBadge({
label: 'pub',
message: isVPlusTripleDottedVersion,
})
t.create('package pre-release version')
.get('/vpre/box2d.json')
.expectJSONTypes(
Joi.object().keys({
name: 'pub',
value: isVPlusTripleDottedVersion,
})
)
.expectBadge({
label: 'pub',
message: isVPlusTripleDottedVersion,
})
t.create('package not found')
.get('/v/does-not-exist.json')
.expectJSON({
name: 'pub',
value: 'not found',
.expectBadge({
label: 'pub',
message: 'not found',
})