Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should call generate workers and return farm promise', () => {
jest.spyOn(console, 'log').mockImplementation(() => {});
promisify.mockReturnValueOnce(jest.fn());
const returnPromise = run('testConfig.js', { colors: false }, jest.fn());
expect(workerFarm.mock.calls[0][0]).toEqual({ maxRetries: 0 });
expect(returnPromise).toBe(Bluebird);
expect(promisify).toHaveBeenCalledTimes(1);
expect(error).toHaveBeenCalledTimes(1);
expect(then).toHaveBeenCalledTimes(2);
expect(Bluebird.finally).toHaveBeenCalledTimes(1);
expect(asCallback).toHaveBeenCalledTimes(1);
});