import { ReqMiddlewareFn , ResMiddlewareFn } from '../src/util' ; export const mockReqMiddleware = ( req ) => { if ( ! Array . isArray ( req . payload ) ) { return { ... req , payload : { ... req . payload , params : [ ... req . payload . params , 'I am a test' ] , } , } ; } return { ... req , payload : { ... req . payload , params : [ ... req . payload , 'I am a test' ] } , } ; } ; export const mockResMiddleware = ( res ) => { if ( res . result && typeof res . result === 'string' ) { return { ... res , result : res . result . toUpperCase ( ) } ; } return res ; } ;