79773403

Date: 2025-09-24 07:38:44
Score: 1
Natty:
Report link
const mockExit = jest.spyOn(process, 'exit').mockImplementation(() => {
    throw new Error('Boom!')
  })
  expect(myFunc(condition)).rejects.toThrow('Boom!')
  expect(mockExit).toHaveBeenCalledWith(ERROR_CODE)
  mockExit.mockRestore()
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Serg