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:
Paul Melnikow
2019-01-15 15:36:52 -05:00
committed by GitHub
parent 55ce947a35
commit a43711fca1

View File

@@ -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')())