title: Jest's `it.each()` description to render arrow function source code when referred as $predicate
body: <h2>Problem definition</h2>
  
  <p>Jest allows the test case's data to be used in <code>it.each</code>'s <code>name</code> via <code>$</code>-prefixed variables.</p>
  
  <p>The code below results in the output like this:</p>
  
  <pre><code> PASS  src/array-functions/find-pairwise.spec.ts
    findPairwise
      √ should return [1, 2] for [1, 2, 3] and [Function anonymous] (7ms)
      √ should return [1, 2] for [1, 2, 3] and [Function anonymous] (1ms)
      √ should return [2, 3] for [1, 2, 3] and [Function anonymous]
      √ should return [2, 3] for [1, 2, 3] and [Function anonymous] (1ms)
      √ should return [undefined, undefined] for [1, 2, 3] and [Function anonymous]
  
  Test Suites: 1 passed, 1 total
  Tests:       5 passed, 5 total
  Snapshots:   0 total
  Time:        4.061s
  Ran all test suites related to changed files.
  </code></pre>
  
  <p>As you can see, the <code>$expected</code> and <code>$array</code> variables are rendered in human-friendly form (basic JavaScript arrays, in this case).
  However, the <code>$predicate</code> shows a generic text <code>[Function anonymous]</code> instead of it's actual code.
  I know that both regular functions and arrow functions in JS can expose their source code if you call <code>.toString()</code> on them.
  Is there a way to instruct Jest render the result of that <code>toString()</code> call?
  I did try <code>$predicate.toString()</code> and <code>$(predicate.toString())</code> but neither of them worked.</p>
  
  <p><a href="https://i.stack.imgur.com/JQfk2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JQfk2.png" alt="enter image description here"></a></p>
  
  <h2>Code</h2>
  
  <pre class="lang-js prettyprint-override"><code>import { findPairwise } from './find-pairwise';
  
  describe(findPairwise.name, () =&gt; {
    it.each`
      array        | predicate                                | expected
      ${[1, 2, 3]} | ${(l: number, r: number) =&gt; l === 1}     | ${[1, 2]}
      ${[1, 2, 3]} | ${(l: number, r: number) =&gt; r === 2}     | ${[1, 2]}
      ${[1, 2, 3]} | ${(l: number, r: number) =&gt; r === 3}     | ${[2, 3]}
      ${[1, 2, 3]} | ${(l: number, r: number) =&gt; l + r === 5} | ${[2, 3]}
      ${[1, 2, 3]} | ${(l: number, r: number) =&gt; l === r }    | ${[undefined, undefined]}
    `
    ('should return $expected for $array and $predicate', ({ array, predicate, expected }) =&gt; {
  //                                         ^^^^^^^^^^
  //                                         ||||||||||
  //                                         I'd like this to be rendered
  //                                         as the code of the arrow function.
  //                                         E.g. "(l: number, r: number) =&gt; l === 1"
  //                                         ...or something close to it.
  
      expect(findPairwise(array, predicate)).toEqual(expected);
    });
  });
  </code></pre>