mirror of
https://github.com/badges/shields.git
synced 2025-04-20 06:47:51 +03:00
Attacking this in two pieces for ease of review. The legacy implementation for coverage is still there, though I disabled it via the route. That whole file will be removed in the next PR. Ref #2863
31 lines
821 B
JavaScript
31 lines
821 B
JavaScript
'use strict'
|
|
|
|
const { ServiceTester } = require('../tester')
|
|
|
|
const t = (module.exports = new ServiceTester({
|
|
id: 'CodeclimateCoverageRedirector',
|
|
title: 'Code Climate Coverage Redirector',
|
|
pathPrefix: '/codeclimate',
|
|
}))
|
|
|
|
t.create('Top-level coverage shortcut')
|
|
.get('/jekyll/jekyll.svg', {
|
|
followRedirect: false,
|
|
})
|
|
.expectStatus(301)
|
|
.expectHeader('Location', '/codeclimate/coverage/jekyll/jekyll.svg')
|
|
|
|
t.create('Coverage shortcut')
|
|
.get('/c/jekyll/jekyll.svg', {
|
|
followRedirect: false,
|
|
})
|
|
.expectStatus(301)
|
|
.expectHeader('Location', '/codeclimate/coverage/jekyll/jekyll.svg')
|
|
|
|
t.create('Coverage letter shortcut')
|
|
.get('/c-letter/jekyll/jekyll.svg', {
|
|
followRedirect: false,
|
|
})
|
|
.expectStatus(301)
|
|
.expectHeader('Location', '/codeclimate/coverage-letter/jekyll/jekyll.svg')
|