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 return a Model instance', async () => {
getMock.mockImplementationOnce(id => id === model.id ? doc : null)
const result = await db.find(model.id)
expect(result).toBeInstanceOf(TestModel)
expect(result).toEqual(model)
expect(getMock).toHaveBeenCalledWith(model.id)
})