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 spawn with yarn if useYarn is false', async () => {
execSync.mockImplementation(() => {
throw new Error('Error!');
});
inquirer.prompt.mockResolvedValueOnce({
name: 'newbot',
platform: 'messenger',
session: 'redis',
server: 'express',
});
await init();
expect(spawn.mock.calls).toContainEqual([
'npm',
['install', '--dev', '--save-exact', '--loglevel', 'error', 'nodemon'],
{ stdio: 'inherit' },
]);
});
});