You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cant seem to get testing to work. I installed the dev dependencies, and I am trying to create a in-memory DB for my test.
First by using the example "const db = new Datastore()" does not work, and the error says options.storage is not defined (even though the readme has no info on whether storage is optional/mandatory). I also tried "const db = new Datastore({inMemoryOnly:true});" same issue.
If I set storage using the AsyncStorage, then the problem changes as AsyncStorage cannot be used in Jest. All docs on testing AsyncStorage tell to mock it. The general mock codes I can find do not seem to work with the react-native-local-mongodb.
How can you set up the test environment to use the Datastore in Jest?
The text was updated successfully, but these errors were encountered:
I cant seem to get testing to work. I installed the dev dependencies, and I am trying to create a in-memory DB for my test.
First by using the example "const db = new Datastore()" does not work, and the error says options.storage is not defined (even though the readme has no info on whether storage is optional/mandatory). I also tried "const db = new Datastore({inMemoryOnly:true});" same issue.
If I set storage using the AsyncStorage, then the problem changes as AsyncStorage cannot be used in Jest. All docs on testing AsyncStorage tell to mock it. The general mock codes I can find do not seem to work with the react-native-local-mongodb.
How can you set up the test environment to use the Datastore in Jest?
The text was updated successfully, but these errors were encountered: