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'm making some unit tests for React components and the hook is not returning anything.
My question is what's the recommended way to implement a mock for a test environment or how can we set a default/initial value? I saw this hook implementation is coupled to the IndexedDb instance, but I guess there should be an alternative to be able to include the useLiveQuery hook on the tests.
The text was updated successfully, but these errors were encountered:
That's right, If indexedDB isn't present (as it normally is not in node unless polyfilled with fakeIndexedDB or indexedDBShim), it won't ever try to execute the given querier callback. Instead the hook will return the defaultValue (3rd argument to useLiveQuery())
I'm making some unit tests for React components and the hook is not returning anything.
My question is what's the recommended way to implement a mock for a test environment or how can we set a default/initial value? I saw this hook implementation is coupled to the IndexedDb instance, but I guess there should be an alternative to be able to include the
useLiveQuery
hook on the tests.The text was updated successfully, but these errors were encountered: