Currently I'm doing this
getByText(/SomeText/i);
But I want to make a function and pass some text as an argument by first storing it in a variable. I tried doing it like this:
let x = "/SomeText/i";
getByText(x);
or
getByText(`/${x}/i`);
But none of the options work.
const x = /Some string/i; getByText(x);
– Reliable