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:
@@ -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' })
|
||||
|
||||
Reference in New Issue
Block a user