Skip to content

Commit 306b1ef

Browse files
committed
Fix refetch test
1 parent f9e0531 commit 306b1ef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/toolkit/src/query/tests/refetchingBehaviors.test.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,12 @@ describe('customListenersHandler', () => {
432432
})
433433
expect(dispatchSpy).toHaveBeenCalled()
434434

435-
// Ignore RTKQ middleware `internal_probeSubscription` calls
436-
const mockCallsWithoutInternals = dispatchSpy.mock.calls.filter(
437-
(call) => !(call[0] as any)?.type?.includes('internal')
438-
)
435+
// Ignore RTKQ middleware internal data calls
436+
const mockCallsWithoutInternals = dispatchSpy.mock.calls.filter((call) => {
437+
const type = (call[0] as any)?.type ?? ''
438+
const reIsInternal = /internal/i
439+
return !reIsInternal.test(type)
440+
})
439441

440442
expect(
441443
defaultApi.internalActions.onOnline.match(

0 commit comments

Comments
 (0)