@@ -35,7 +35,11 @@ import { server } from './mocks/server'
3535import type { UnknownAction } from 'redux'
3636import type { SubscriptionOptions } from '@reduxjs/toolkit/dist/query/core/apiState'
3737import type { SerializedError } from '@reduxjs/toolkit'
38- import { createListenerMiddleware , configureStore , createSlice } from '@reduxjs/toolkit'
38+ import {
39+ createListenerMiddleware ,
40+ configureStore ,
41+ createSlice ,
42+ } from '@reduxjs/toolkit'
3943import { delay } from '../../utils'
4044import type { SubscriptionSelectors } from '../core/buildMiddleware/types'
4145import { countObjectKeys } from '../utils/countObjectKeys'
@@ -1479,7 +1483,7 @@ describe('hooks tests', () => {
14791483
14801484 userEvent . hover ( screen . getByTestId ( 'highPriority' ) )
14811485 expect (
1482- api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) as any )
1486+ api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) )
14831487 ) . toEqual ( {
14841488 data : { name : 'Timmy' } ,
14851489 endpointName : 'getUser' ,
@@ -1500,7 +1504,7 @@ describe('hooks tests', () => {
15001504 )
15011505
15021506 expect (
1503- api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) as any )
1507+ api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) )
15041508 ) . toEqual ( {
15051509 data : { name : 'Timmy' } ,
15061510 endpointName : 'getUser' ,
@@ -1548,7 +1552,7 @@ describe('hooks tests', () => {
15481552 userEvent . hover ( screen . getByTestId ( 'lowPriority' ) )
15491553
15501554 expect (
1551- api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) as any )
1555+ api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) )
15521556 ) . toEqual ( {
15531557 data : { name : 'Timmy' } ,
15541558 endpointName : 'getUser' ,
@@ -1566,7 +1570,7 @@ describe('hooks tests', () => {
15661570 await waitMs ( )
15671571
15681572 expect (
1569- api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) as any )
1573+ api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) )
15701574 ) . toEqual ( {
15711575 data : { name : 'Timmy' } ,
15721576 endpointName : 'getUser' ,
@@ -1616,7 +1620,7 @@ describe('hooks tests', () => {
16161620 // This should run the query being that we're past the threshold
16171621 userEvent . hover ( screen . getByTestId ( 'lowPriority' ) )
16181622 expect (
1619- api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) as any )
1623+ api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) )
16201624 ) . toEqual ( {
16211625 data : { name : 'Timmy' } ,
16221626 endpointName : 'getUser' ,
@@ -1636,7 +1640,7 @@ describe('hooks tests', () => {
16361640 )
16371641
16381642 expect (
1639- api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) as any )
1643+ api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) )
16401644 ) . toEqual ( {
16411645 data : { name : 'Timmy' } ,
16421646 endpointName : 'getUser' ,
@@ -1683,13 +1687,13 @@ describe('hooks tests', () => {
16831687
16841688 // Get a snapshot of the last result
16851689 const latestQueryData = api . endpoints . getUser . select ( USER_ID ) (
1686- storeRef . store . getState ( ) as any
1690+ storeRef . store . getState ( )
16871691 )
16881692
16891693 userEvent . hover ( screen . getByTestId ( 'lowPriority' ) )
16901694 // Serve up the result from the cache being that the condition wasn't met
16911695 expect (
1692- api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) as any )
1696+ api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) )
16931697 ) . toEqual ( latestQueryData )
16941698 } )
16951699
@@ -1717,7 +1721,7 @@ describe('hooks tests', () => {
17171721 userEvent . hover ( screen . getByTestId ( 'lowPriority' ) )
17181722
17191723 expect (
1720- api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) as any )
1724+ api . endpoints . getUser . select ( USER_ID ) ( storeRef . store . getState ( ) )
17211725 ) . toEqual ( {
17221726 endpointName : 'getUser' ,
17231727 isError : false ,
@@ -2053,13 +2057,13 @@ describe('hooks with createApi defaults set', () => {
20532057 } )
20542058
20552059 const counterSlice = createSlice ( {
2056- name : " counter" ,
2060+ name : ' counter' ,
20572061 initialState : { count : 0 } ,
20582062 reducers : {
20592063 increment ( state ) {
20602064 state . count ++
2061- }
2062- }
2065+ } ,
2066+ } ,
20632067 } )
20642068
20652069 const storeRef = setupApiStore ( api , {
@@ -2353,7 +2357,9 @@ describe('hooks with createApi defaults set', () => {
23532357 return (
23542358 < div
23552359 data-testid = "incrementButton"
2356- onClick = { ( ) => storeRef . store . dispatch ( counterSlice . actions . increment ( ) ) }
2360+ onClick = { ( ) =>
2361+ storeRef . store . dispatch ( counterSlice . actions . increment ( ) )
2362+ }
23572363 >
23582364 Increment Count
23592365 </ div >
0 commit comments