Files
shields/services/sonar/sonar-tech-debt.tester.js
Paul Melnikow 6a2f384860 Update [Sonar] routes: metric first, and server in the query string (#3696)
This is the preferred way we’re handling server URLs: in the query string.

While we still have a mix of these, I’ve argued this way is better for these reasons:

1. It allows us to make the URLs a bit more standardized across services.
2. It makes the routes unambiguous.
3. It requires less code.

While it introduces a URL-encoding requirement on the parameter, I think these tradeoffs are worth it.
2019-07-14 17:06:14 -04:00

23 lines
594 B
JavaScript

'use strict'
const { isIntegerPercentage } = require('../test-validators')
const t = (module.exports = require('../tester').createServiceTester())
t.create('Tech Debt')
.get(
'/tech_debt/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com'
)
.expectBadge({
label: 'tech debt',
message: isIntegerPercentage,
})
t.create('Tech Debt (legacy API supported)')
.get(
'/tech_debt/org.ow2.petals%3Apetals-se-ase.json?server=http://sonar.petalslink.com&sonarVersion=4.2'
)
.expectBadge({
label: 'tech debt',
message: isIntegerPercentage,
})