Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('invalid', () => {
const realProcess = process
const exitMock = jest.fn()
consola.clear().add({
log: jest.fn()
})
global.process = { ...realProcess, exit: exitMock }
const sourceDir = path.resolve(tempPath, 'invalid')
generateConfig(sourceDir, {})
expect(consola.reporters[0]['log'].mock['calls'][0][0]['additional']).toMatchSnapshot()
expect(exitMock).toHaveBeenCalledWith(1)
global.process = realProcess
})
})