Split up [codeclimate] tests (#3300)
* Split up [codeclimate] tests * Fix copy-pasta
This commit is contained in:
committed by
Caleb Cartwright
parent
d343fddb2c
commit
11cd0bdbc5
53
services/codeclimate/codeclimate-coverage.tester.js
Normal file
53
services/codeclimate/codeclimate-coverage.tester.js
Normal file
@@ -0,0 +1,53 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const { ServiceTester } = require('../tester')
|
||||
const { isIntegerPercentage } = require('../test-validators')
|
||||
|
||||
const t = (module.exports = new ServiceTester({
|
||||
id: 'CodeClimateCoverage',
|
||||
title: 'Code Climate',
|
||||
pathPrefix: '/codeclimate',
|
||||
}))
|
||||
|
||||
t.create('test coverage percentage')
|
||||
.get('/c/jekyll/jekyll.json')
|
||||
.expectBadge({
|
||||
label: 'coverage',
|
||||
message: isIntegerPercentage,
|
||||
})
|
||||
|
||||
t.create('test coverage percentage alternative coverage URL')
|
||||
.get('/coverage/jekyll/jekyll.json')
|
||||
.expectBadge({
|
||||
label: 'coverage',
|
||||
message: isIntegerPercentage,
|
||||
})
|
||||
|
||||
t.create('test coverage percentage alternative top-level URL')
|
||||
.get('/jekyll/jekyll.json')
|
||||
.expectBadge({
|
||||
label: 'coverage',
|
||||
message: isIntegerPercentage,
|
||||
})
|
||||
|
||||
t.create('test coverage letter')
|
||||
.get('/c-letter/jekyll/jekyll.json')
|
||||
.expectBadge({
|
||||
label: 'coverage',
|
||||
message: Joi.equal('A', 'B', 'C', 'D', 'E', 'F'),
|
||||
})
|
||||
|
||||
t.create('test coverage percentage for non-existent repo')
|
||||
.get('/c/unknown/unknown.json')
|
||||
.expectBadge({
|
||||
label: 'coverage',
|
||||
message: 'not found',
|
||||
})
|
||||
|
||||
t.create('test coverage percentage for repo without test reports')
|
||||
.get('/c/angular/angular.js.json')
|
||||
.expectBadge({
|
||||
label: 'coverage',
|
||||
message: 'unknown',
|
||||
})
|
||||
Reference in New Issue
Block a user