title: How to test a function that output is random using Jest?
body: <p>How to test a function that output is random using Jest? Like this:</p>
  
  <pre><code>import cuid from 'cuid';  
  const functionToTest = (value) =&gt; ({
      [cuid()]: {
          a: Math.random(),
          b: new Date().toString(),
          c: value,
      }
  });
  </code></pre>
  
  <p>So the output of <code>functionToTest('Some predictable value')</code> will be something like:</p>
  
  <pre><code>{
    'cixrchnp60000vhidc9qvd10p': {
      a: 0.08715126430943698,
      b: 'Tue Jan 10 2017 15:20:58 GMT+0200 (EET)',
      c: 'Some predictable value'
    },
  }
  </code></pre>