1
0
mirror of https://github.com/badges/shields.git synced 2025-11-27 06:21:18 +03:00

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,23 +1,20 @@
'use strict'
const Joi = require('joi')
const { isFormattedDate } = require('../test-validators')
const t = (module.exports = require('../tester').createServiceTester())
t.create('last commit (recent)')
.get('/eslint/eslint.json')
.expectJSONTypes(
Joi.object().keys({ name: 'last commit', value: isFormattedDate })
)
.expectBadge({ label: 'last commit', message: isFormattedDate })
t.create('last commit (ancient)')
.get('/badges/badgr.co.json')
.expectJSON({ name: 'last commit', value: 'january 2014' })
.expectBadge({ label: 'last commit', message: 'january 2014' })
t.create('last commit (on branch)')
.get('/badges/badgr.co/shielded.json')
.expectJSON({ name: 'last commit', value: 'july 2013' })
.expectBadge({ label: 'last commit', message: 'july 2013' })
t.create('last commit (repo not found)')
.get('/badges/helmets.json')
.expectJSON({ name: 'last commit', value: 'repo not found' })
.expectBadge({ label: 'last commit', message: 'repo not found' })