@@ -244,10 +244,10 @@ describe('queryFn base implementation tests', () => {
244244
245245 const thunk = endpoint . initiate ( endpointName )
246246
247- const result = ( await store . dispatch ( thunk ) ) satisfies
247+ const result :
248248 | undefined
249249 | { data : string }
250- | { error : string | SerializedError }
250+ | { error : string | SerializedError } = await store . dispatch ( thunk )
251251
252252 if ( endpointName . includes ( 'Throw' ) ) {
253253 expect ( consoleErrorSpy ) . toHaveBeenCalledOnce ( )
@@ -291,7 +291,7 @@ describe('queryFn base implementation tests', () => {
291291 {
292292 const thunk = withNeither . initiate ( 'withNeither' )
293293
294- const result = ( await store . dispatch ( thunk ) ) satisfies QuerySubState < any >
294+ const result : QuerySubState < any > = await store . dispatch ( thunk )
295295
296296 expect ( consoleErrorSpy ) . toHaveBeenCalledOnce ( )
297297
@@ -311,10 +311,10 @@ describe('queryFn base implementation tests', () => {
311311 {
312312 const thunk = mutationWithNeither . initiate ( 'mutationWithNeither' )
313313
314- const result = ( await store . dispatch ( thunk ) ) satisfies
314+ const result :
315315 | undefined
316316 | { data : string }
317- | { error : string | SerializedError }
317+ | { error : string | SerializedError } = await store . dispatch ( thunk )
318318
319319 expect ( consoleErrorSpy ) . toHaveBeenCalledOnce ( )
320320
@@ -323,6 +323,10 @@ describe('queryFn base implementation tests', () => {
323323 TypeError ( 'endpointDefinition.queryFn is not a function' ) ,
324324 )
325325
326+ if ( ! ( 'error' in result ) ) {
327+ expect . fail ( )
328+ }
329+
326330 expect ( result . error ) . toEqual (
327331 expect . objectContaining ( {
328332 message : 'endpointDefinition.queryFn is not a function' ,
@@ -417,9 +421,9 @@ describe('usage scenario tests', () => {
417421 it ( 'can wrap a service like Firebase and handle errors' , async ( ) => {
418422 const consoleErrorSpy = vi . spyOn ( console , 'error' ) . mockImplementation ( noop )
419423
420- const result = ( await storeRef . store . dispatch (
424+ const result : QuerySubState < any > = await storeRef . store . dispatch (
421425 api . endpoints . getMissingFirebaseUser . initiate ( 1 ) ,
422- ) ) satisfies QuerySubState < any >
426+ )
423427
424428 expect ( consoleErrorSpy ) . toHaveBeenCalledOnce ( )
425429
0 commit comments