* refactor(logger): assume that console is always defined
* test(utils): isPlainObject: should return `false` if the object has a modified prototype
* test(utils): scheduleMicrotask should throw an exception if the callback throw an error
* test(InfiniteQueryObserver): should error if queryFn not defined
* test(InfiniteQueryObserver): should not refetch the first page if refetch another page
* fix(logger): logger is always defined with the console
* test(InfiniteQueryBehavior): move new tests to InfiniteQueryBehavior
* test(QueryCache): add and remove tests
* test(QueryCache): add find with filters.exact defined
fix test.only on previous commit too.
* test(QueryCache): return all queries when no filters are set
fix: comparison in find(); filters object is always defined but could be empty.
* test(mutationObserver): add onUnsubscribe and notify tests
notify: there is no use case in the lib with listeners set to false.
* test(queriesObserver): should not destroy the observer if there is still a subscription
* test(queriesObserver): onUpdate should not update the result for an unknown observer
No onUpdate use case has been found with a possible unknown observer.
* test(queryObserver): the retrier should not throw an error when reject if the retrier is already resolved
* test(InfiniteQueryBehavior): add signal support
* test(hydration): dehydrateQueries false, mutation state pause, hydratedState empty
* test(focusManager): add full coverage tests
* test(query): should set default options
* test(query): should refetch the observer when online method is called
* test(query: should not add an existing observer
* test(query): should not try to remove an observer that does not exist
* test(query): should not dispatch on invalidate if already invalidated
* test(query): reducer should return the state for an unknown action type
Typescript made this case not possible.
* test(query): fetch should not dispatch fetch if meta has not changed
* test(queryClient): setQueryData should use prev data if isDataEqual fct is true
* test(queryClient): setQueryData should set the new data without comparison if structuralSharing is set to false
move related tests into 'setQueryData' test suite
* test(query): fetch should not set the signal if AbortController is undefined
* test(query): fetch should throw an error if the queryFn is not defined
* test(query): fetch should dispatch fetch if is fetching and current promise is undefined
* test(query): constructor should call initialDataUpdatedAt if defined as a function
* test(queryObserver): should throw an error if enabled option type is not valid
* test(queryObserver): getCurrentQuery should return the current query
* test(queryObserver): should throw an error if throwOnError option is true
* test(queryObserver): should not refetch in background if refetchIntervalInBackground is false
* test(queryObserver): should not use replaceEqualDeep for select value when structuralSharing option is true
* test(queryObserver): add placeholderdata related tests
* fix(queryObserver): shouldNotifyListeners: remove useless condition
updateResult function already check the result with shallowEqualObjects
* test(queryObserver): updateResult should not notify cache listeners if cache option is false
* test(queryObserver): add stale timeout notify test
* test(mutation): setState should update the mutation state
setState is not used in the lib, need to force the usage in the test
* test(mutation): addObserver should not add an existing observer
No use case found, need to use the private method for the test.
* Revert "test(mutation): addObserver should not add an existing observer"
This reverts commit 3643be9518.
* test(mutation): addObserver should not add an existing observer
* test(mutation): executeMutation should throw an error if no mutationFn found
* test(mutation): cancel mutation should not call mutationFn if the current retrier is undefined
Force retryer to undefined because no use case has been found.
* Revert "fix(logger): logger is always defined with the console"
This reverts commit dd64fda076.
* test(mutation): reducer should return the state for an unknown action type
* test(onlineManager): isOnline: add navigator related tests
* test(onlineManager): setEventListener should use online boolean arg
* test(onlineManager): add setEventListener tests
* test(notifyManager): add notifyFn and batchNotifyFn tests
Add a notifyManagerTest singleton because jest.setup.js override notifyFn value.
* test(queryClient): add focusManager and onlineManager related test
* test(queryClient): cancelQueries should not revert if revert is false
* test(queryClient): refetchQueries should throw if throwOnError is true
* test(queryClient): add cancelMutations test
* test(queryClient): should get defaultOptions
* test(queryClient): should update existing query defaults
* test(queryClient): setMutationDefaults should update existing mutation defaults
* test(utils): parseMutationArgs should return mutation options
* test(utils): matchMutation should return false if mutationKey options is undefined
* test(utils): isPlainObject add tests
* test(core): use @ts-expect-error instead of @ts-ignore when possible
* test(core): export NotifyManager for testing purposes
* test(queryObserver): fix test comment
Fix progressively smaller font size for Explorer entries in devtools
Set Entry font-size to 1em, because it is indented multiple time within each other.
This causes the font to get smaller and smaller as `em` is relative to the parent font size.
Explained that this new AbortSignal feature was introduced at 3.30.0 and that users need to either upgrade (recommended) or use the old cancel function.
change the `isOpen` prop for the ReactQueryDevtoolsPanel component to default
to true. The subscriptions aren't set up when no isOpen prop is passed, which makes
the panel not show any updates when used without the isOpen prop.
Closes#2745