jeudi 21 décembre 2017

IndexedDB testing with Jest & enzyme - ReferenceError: indexedDB is not defined

I'm looking for help with unit tests for my app, where I'm using indexedDB. Before I implemented indexedDB functionality, tests were correct. But now, for all of them I see one error:

ReferenceError: indexedDB is not defined

Can someone give me an advice how to get rid of that error? I was searching information, and trying different ways to mock 'window', or 'indexedDB', but with no result.

Thanks.

Aucun commentaire:

Enregistrer un commentaire