Files
shields/services/criterion/criterion.tester.js
Caleb Cartwright 9ef79889b0 test(criterion): fix failing service test (#5521)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2020-09-12 14:27:02 +00:00

22 lines
586 B
JavaScript

'use strict'
const Joi = require('@hapi/joi')
const t = (module.exports = require('../tester').createServiceTester())
const {
IMPROVED_STATUS,
REGRESSED_STATUS,
NOT_FOUND_STATUS,
} = require('./constants')
const isStatus = Joi.string()
.allow(IMPROVED_STATUS, NOT_FOUND_STATUS, REGRESSED_STATUS)
.required()
t.create('Criterion (valid repo)')
.get('/chmoder/credit_card.json')
.expectBadge({ label: 'criterion', message: isStatus })
t.create('Criterion (not found)')
.get('/chmoder/not-a-repo.json')
.expectBadge({ label: 'criterion', message: NOT_FOUND_STATUS })