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)
pMap.mockRejectedValueOnce(new Error('Unexpected Error'))
const taskFn = resolveTaskFn({ ...defaultOpts })
try {
await taskFn()
} catch (err) {
expect(err.message).toMatch(dedent`
${logSymbols.error} test got an unexpected error.
Unexpected Error
`)
}
})
})