Use simpler regexes in [appveyortests] to address lgtm alert (#2768)
Two of these regexes have triggered a LGTM alert. https://lgtm.com/rules/1505904457770/ I’m not terribly concerned about it given this is a test, though it’s nice to clear these up, and the new regexes are a bit easier to understand.
This commit is contained in:
@@ -3,19 +3,19 @@
|
||||
const Joi = require('joi')
|
||||
|
||||
const isAppveyorTestTotals = Joi.string().regex(
|
||||
/^(?:[0-9]+ (?:passed|skipped|failed)(?:, )?)+$/
|
||||
/^[0-9]+ passed(, [0-9]+ failed)?(, [0-9]+ skipped)?$/
|
||||
)
|
||||
|
||||
const isCompactAppveyorTestTotals = Joi.string().regex(
|
||||
/^(?:[0-9]* ?(?:✔|✘|➟) ?[0-9]*(?:, | \| )?)+$/
|
||||
/^✔ [0-9]+( \| ✘ [0-9]+)?( \| ➟ [0-9]+)?$/
|
||||
)
|
||||
|
||||
const isCustomAppveyorTestTotals = Joi.string().regex(
|
||||
/^(?:[0-9]+ (?:good|bad|n\/a)(?:, )?)+$/
|
||||
/^[0-9]+ good(, [0-9]+ bad)?(, [0-9]+ n\/a)?$/
|
||||
)
|
||||
|
||||
const isCompactCustomAppveyorTestTotals = Joi.string().regex(
|
||||
/^(?:[0-9]* ?(?:💃|🤦♀️|🤷) ?[0-9]*(?:, | \| )?)+$/
|
||||
/^💃 [0-9]+( \| 🤦♀️ [0-9]+)?( \| 🤷 [0-9]+)?$/
|
||||
)
|
||||
|
||||
const t = (module.exports = require('../create-service-tester')())
|
||||
|
||||
Reference in New Issue
Block a user