Files
shields/services/sonar/sonar-tests.spec.js
Caleb Cartwright ea865436a1 add [Sonar] badges for various test metrics (#3571)
* feat: add SonarTests badges

* chore: remove commented out line

* refactor: update SonarTestsSummary to override transform
2019-07-01 15:46:51 -05:00

40 lines
1023 B
JavaScript

'use strict'
const { test, given } = require('sazerac')
const SonarTests = require('./sonar-tests.service')[1]
describe('SonarTests', function() {
test(SonarTests.render, () => {
given({ value: 0, metric: 'test_failures' }).expect({
label: 'test failures',
message: '0',
color: 'brightgreen',
})
given({ value: 0, metric: 'test_errors' }).expect({
label: 'test errors',
message: '0',
color: 'brightgreen',
})
given({ value: 2, metric: 'test_failures' }).expect({
label: 'test failures',
message: '2',
color: 'red',
})
given({ value: 1, metric: 'test_errors' }).expect({
label: 'test errors',
message: '1',
color: 'red',
})
given({ value: 100, metric: 'test_success_density' }).expect({
label: 'tests',
message: '100%',
color: 'brightgreen',
})
given({ value: 93, metric: 'test_success_density' }).expect({
label: 'tests',
message: '93%',
color: 'red',
})
})
})