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 handle unexpected error', async () => {
expect.assertions(1)
pMapMock.mockImplementation(() => Promise.reject(new Error('Unexpected Error')))
const [linter] = runScript(['test'], ['test.js'])
try {
await linter.task()
} catch (err) {
expect(err.message).toMatch(dedent`
${logSymbols.error} test got an unexpected error.
Unexpected Error
`)
}
})
})