How to use the pouchdb-browser.getMock.mockImplementationOnce function in pouchdb-browser

To help you get started, we’ve selected a few pouchdb-browser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ArkEcosystem / desktop-wallet / __tests__ / unit / store / db / interface.spec.js View on Github external
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)
    })