refactor [JenkinsTests JenkinsCoverage], also run [JenkinsBuild] (#3337)
* refactor(JenkinsTests): finished core refactor to new service model * refactor(JenkinsTests): more updates * refactor(JenkinsCoverage): minor refactor to leverage new common Jenkins content * refactor(JenkinsBuild): update redirector to include shorthand alias * chore: apply suggestion on jenkins-tests.service.js Co-Authored-By: calebcartwright <calebcartwright@users.noreply.github.com> * refactor(JenkinsTests): rename test helpers * chore: cleanup JenkinsCoverage redirector * chore: cleanup JenkinsBuild redirector * chore: cleanup test docs
This commit is contained in:
@@ -91,6 +91,39 @@ const isDependencyState = withRegex(
|
||||
/^(\d+ out of date|\d+ deprecated|up to date)$/
|
||||
)
|
||||
|
||||
const makeTestTotalsValidator = ({ passed, failed, skipped }) =>
|
||||
withRegex(
|
||||
new RegExp(`^[0-9]+ ${passed}(, [0-9]+ ${failed})?(, [0-9]+ ${skipped})?$`)
|
||||
)
|
||||
|
||||
const makeCompactTestTotalsValidator = ({ passed, failed, skipped }) =>
|
||||
withRegex(
|
||||
new RegExp(
|
||||
`^${passed} [0-9]+( \\| ${failed} [0-9]+)?( \\| ${skipped} [0-9]+)?$`
|
||||
)
|
||||
)
|
||||
|
||||
const isDefaultTestTotals = makeTestTotalsValidator({
|
||||
passed: 'passed',
|
||||
failed: 'failed',
|
||||
skipped: 'skipped',
|
||||
})
|
||||
const isDefaultCompactTestTotals = makeCompactTestTotalsValidator({
|
||||
passed: '✔',
|
||||
failed: '✘',
|
||||
skipped: '➟',
|
||||
})
|
||||
const isCustomTestTotals = makeTestTotalsValidator({
|
||||
passed: 'good',
|
||||
failed: 'bad',
|
||||
skipped: 'n/a',
|
||||
})
|
||||
const isCustomCompactTestTotals = makeCompactTestTotalsValidator({
|
||||
passed: '💃',
|
||||
failed: '🤦♀️',
|
||||
skipped: '🤷',
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
isSemver,
|
||||
isVPlusTripleDottedVersion,
|
||||
@@ -111,4 +144,10 @@ module.exports = {
|
||||
isRelativeFormattedDate,
|
||||
isDependencyState,
|
||||
withRegex,
|
||||
isDefaultTestTotals,
|
||||
isDefaultCompactTestTotals,
|
||||
isCustomTestTotals,
|
||||
isCustomCompactTestTotals,
|
||||
makeTestTotalsValidator,
|
||||
makeCompactTestTotalsValidator,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user