Files
shields/services/testspace/testspace-test-pass-ratio.tester.js
2021-07-09 12:53:55 +01:00

25 lines
699 B
JavaScript

import { createServiceTester } from '../tester.js'
import { isIntegerPercentage } from '../test-validators.js'
export const t = await createServiceTester()
t.create('Non-existent or unauthorized org')
.get('/swellaby1239017823123/swellaby:testspace-sample/main.json')
.expectBadge({
label: 'tests',
message: 'org not found or not authorized',
})
t.create('Non-existent project')
.get('/swellaby/swellaby:nope/main/baz.json')
.expectBadge({
label: 'tests',
message: 'org, project, or space not found',
})
t.create('Valid project space')
.get('/swellaby/swellaby:testspace-sample/main.json')
.expectBadge({
label: 'tests',
message: isIntegerPercentage,
})