tests: fix CodeClimate Analysis service tests (#4191)

This commit is contained in:
Caleb Cartwright
2019-10-18 13:33:12 -05:00
committed by GitHub
parent d0c5a599b1
commit 68c8b94d0c
2 changed files with 9 additions and 9 deletions

View File

@@ -109,7 +109,7 @@ module.exports = class CodeclimateAnalysis extends BaseJsonService {
namedParams: {
format: 'maintainability',
user: 'angular',
repo: 'angular.js',
repo: 'angular',
},
staticPreview: this.render({
variant: 'maintainability',
@@ -130,7 +130,7 @@ module.exports = class CodeclimateAnalysis extends BaseJsonService {
{
title: 'Code Climate technical debt',
pattern: 'tech-debt/:user/:repo',
namedParams: { user: 'jekyll', repo: 'jekyll' },
namedParams: { user: 'angular', repo: 'angular' },
staticPreview: this.render({
variant: 'tech-debt',
techDebtPercentage: 3.0,

View File

@@ -5,7 +5,7 @@ const { isIntegerPercentage } = require('../test-validators')
const t = (module.exports = require('../tester').createServiceTester())
t.create('issues count')
.get('/issues/angular/angular.js.json')
.get('/issues/angular/angular.json')
.expectBadge({
label: 'issues',
message: Joi.number()
@@ -14,21 +14,21 @@ t.create('issues count')
})
t.create('technical debt percentage')
.get('/tech-debt/angular/angular.js.json')
.get('/tech-debt/angular/angular.json')
.expectBadge({
label: 'technical debt',
message: isIntegerPercentage,
})
t.create('maintainability percentage')
.get('/maintainability-percentage/angular/angular.js.json')
.get('/maintainability-percentage/angular/angular.json')
.expectBadge({
label: 'maintainability',
message: isIntegerPercentage,
})
t.create('maintainability letter')
.get('/maintainability/angular/angular.js.json')
.get('/maintainability/angular/angular.json')
.expectBadge({
label: 'maintainability',
message: Joi.equal('A', 'B', 'C', 'D', 'E', 'F'),
@@ -49,10 +49,10 @@ t.create('maintainability letter for repo without snapshots')
})
t.create('malformed response for outer user repos query')
.get('/maintainability/angular/angular.js.json')
.get('/maintainability/angular/angular.json')
.intercept(nock =>
nock('https://api.codeclimate.com')
.get('/v1/repos?github_slug=angular%2Fangular.js')
.get('/v1/repos?github_slug=angular%2Fangular')
.reply(200, {
data: [{}], // No relationships in the list of data elements.
})
@@ -63,7 +63,7 @@ t.create('malformed response for outer user repos query')
})
t.create('malformed response for inner specific repo query')
.get('/maintainability/angular/angular.js.json')
.get('/maintainability/angular/angular.json')
.intercept(nock =>
nock('https://api.codeclimate.com', { allowUnmocked: true })
.get(/\/v1\/repos\/[a-z0-9]+\/snapshots\/[a-z0-9]+/)