I would like to add a variable, 'example', into a regular expression assertion.
const example = Selector('xyz');
await t.expect(getLocation()).match(/^https:\/\/int-.*.example.com\/en\/example\/-\/ ** HERE SHOULD BE INSERTED A VARIABLE, 'example' ** \/$/)
How could I do this?
You can make it using the RegExp Constructor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With