How can I store Regex value in cypress config file? I'm using the following regex in the test:
cy.get('.company_highlight').contains(/JPM|Morgan/g)
When I put this value in the config file I have to store it as string, but then the test will fail since its a string value.
I tried directl inputting that value into config file:
cypress.json
{
"Company":/JPM|Morgan/g
}
And in the test:
cy.get('.company_highlight').contains(Cypress.config().Company)
Which gives error:
Unexpected token / in JSON