From 9e7bea5bb3615abfe3aded0a2a41fd3a9fb1372f Mon Sep 17 00:00:00 2001 From: Naz Date: Thu, 19 May 2022 13:06:50 +0800 Subject: [PATCH] Added "anyStringNumber" matcher to e2e framework refs https://github.com/TryGhost/Toolbox/issues/335 - Existing `anyNumber` matcher does not do a job when the number is stringified, so introduced a new string matcher to match stringified numbers --- test/utils/e2e-framework.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/utils/e2e-framework.js b/test/utils/e2e-framework.js index 137825002c..87db122c14 100644 --- a/test/utils/e2e-framework.js +++ b/test/utils/e2e-framework.js @@ -280,6 +280,7 @@ module.exports = { anyString: any(String), anyArray: any(Array), anyNumber: any(Number), + anyStringNumber: stringMatching(/\d+/), anyISODateTime: stringMatching(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.000Z/), anyISODate: stringMatching(/\d{4}-\d{2}-\d{2}/), anyISODateTimeWithTZ: stringMatching(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.000\+\d{2}:\d{2}/),