title: How do I mock a return value multiple times with different values in the same test?
body: <p>I've built a module that searches for files using <a href="https://github.com/isaacs/node-glob" rel="noreferrer">node-glob</a>.</p>
  <pre class="lang-js prettyprint-override"><code>// fileCollector.js
  const glob = require('glob');
  
  exports.getFiles = (directory) =&gt; {
    return {
      freeMarker: glob.sync(directory + '/**/*.ftl'),
      sass: glob.sync(directory + '/**/*.scss')
    };
  };
  </code></pre>
  <p>I'm attempting to write a test so that I can verify that:</p>
  <ol>
  <li>Glob was called twice with the correct arguments</li>
  <li>The return value of <code>getFiles</code> is correct</li>
  </ol>
  <pre class="lang-js prettyprint-override"><code>// fileCollector.test.js
  const glob = require('glob');
  const fileCollector = require('fileCollector');
  
  jest.mock('glob');
  
  describe('getFiles', () =&gt; {
    it('should get files', () =&gt; {
      const files = fileCollector.getFiles('/path/to/files');
  
      expect(glob.sync.mock.calls).toEqual([['/path/to/files/**/*.ftl'], ['/path/to/files/**/*.scss']]);
      expect(files).toEqual({
        freeMarker: 'INSERT_MOCKED_VALUE_FROM_GLOB',
        sass: 'INSERT_MOCKED_VALUE_FROM_GLOB'
      });
    });
  });
  </code></pre>
  <p>How do I mock the return value of glob twice with two separate return values so that I can test the return value of <code>getFiles</code>?</p>
  <hr />
  <p><strong>Note:</strong> <a href="https://stackoverflow.com/a/49769025/11809808">Jest mock module multiple times with different values</a> does not answer my question because it mocks a different value once in separate  tests.</p>