From e6559a0889b22d019ad71df027ecbd14df7635c2 Mon Sep 17 00:00:00 2001 From: chris48s Date: Sat, 2 Jun 2018 19:03:55 +0100 Subject: [PATCH] fix typescript regex in [npm] tests (#1712) - Expect `TypeScript vX.Y | Flow vX.Y` instead of `TypeScript vX.Y Flow vX.Y` - Allow version numbers to have more than >1 digit after the point --- services/npm/npm.tester.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/npm/npm.tester.js b/services/npm/npm.tester.js index 4acddd7929..3e64b441f5 100644 --- a/services/npm/npm.tester.js +++ b/services/npm/npm.tester.js @@ -11,7 +11,7 @@ const t = new ServiceTester({ id: 'npm', title: 'NPM' }); module.exports = t; const colorsB = mapValues(colorscheme, 'colorB'); -const isTypeDefinition = Joi.string().regex(/^(Flow|TypeScript) v?[0-9]+.[0-9]( (Flow|TypeScript) v?[0-9]+.[0-9])?$/); +const isTypeDefinition = Joi.string().regex(/^(Flow|TypeScript) v?[0-9]+.[0-9]+( \| (Flow|TypeScript) v?[0-9]+.[0-9]+)?$/); t.create('total downloads of left-pad') .get('/dt/left-pad.json?style=_shields_test')