title: How to pass a an argument to getByText in react Testing Library?
body: <p>Currently I'm doing this</p>
  <pre><code>getByText(/SomeText/i);
  </code></pre>
  <p>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:</p>
  <pre><code>let x = &quot;/SomeText/i&quot;;
  getByText(x);
  </code></pre>
  <p>or</p>
  <pre><code>getByText(`/${x}/i`);
  </code></pre>
  <p>But none of the options work.</p>