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
This commit is contained in:
Naz 2022-05-19 13:06:50 +08:00
parent 998584f6e1
commit 9e7bea5bb3

View File

@ -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}/),