@@ -13,10 +13,11 @@ import Context from '@/vo/Context';
1313
1414// utils
1515import createMockAxiosInstance from '@test-utils/createMockAxiosInstance' ;
16+ import createMockAxiosRequestClient from '@test-utils/createMockAxiosInstance' ;
1617import { createMockItem , createMockResponse } from '@test-utils/nlic' ;
1718
1819describe ( 'Service' , ( ) => {
19- let mockAxios : ReturnType < typeof createMockAxiosInstance > ;
20+ let mockAxios : ReturnType < typeof createMockAxiosRequestClient > ;
2021
2122 beforeEach ( ( ) => {
2223 mockAxios = createMockAxiosInstance ( ) ;
@@ -38,7 +39,7 @@ describe('Service', () => {
3839
3940 const response = await Service . get ( context , 'token/123' , { } , { onResponse, onInfo } ) ;
4041
41- expect ( mockAxios ) . toHaveBeenCalledOnce ( ) ;
42+ expect ( mockAxios . request ) . toHaveBeenCalledOnce ( ) ;
4243 expect ( onResponse ) . toHaveBeenCalledWith ( response ) ;
4344 expect ( onInfo ) . toHaveBeenCalledWith ( infos ) ;
4445 expect ( response ) . toMatchObject ( { data } ) ;
@@ -61,7 +62,7 @@ describe('Service', () => {
6162
6263 await method ( context , 'some-url' , payload , { axiosInstance : mockAxios } ) ;
6364
64- expect ( mockAxios ) . toHaveBeenCalledWith (
65+ expect ( mockAxios . request ) . toHaveBeenCalledWith (
6566 expect . objectContaining ( {
6667 headers : expect . objectContaining ( { Accept : 'application/json' } ) as Record < string , string > ,
6768 url : expect . stringContaining ( 'some-url' ) as string ,
@@ -76,7 +77,7 @@ describe('Service', () => {
7677
7778 await method ( context , 'some-url' , { } , { axiosInstance : mockAxios } ) ;
7879
79- expect ( mockAxios ) . toHaveBeenCalledWith (
80+ expect ( mockAxios . request ) . toHaveBeenCalledWith (
8081 expect . objectContaining ( {
8182 auth : {
8283 username : context . getUsername ( ) ,
@@ -91,7 +92,7 @@ describe('Service', () => {
9192
9293 await method ( context , 'some-url' , { } , { axiosInstance : mockAxios } ) ;
9394
94- expect ( mockAxios ) . toHaveBeenCalledWith (
95+ expect ( mockAxios . request ) . toHaveBeenCalledWith (
9596 expect . objectContaining ( {
9697 headers : expect . objectContaining ( {
9798 Authorization : `Basic ${ btoa ( 'apiKey:some-api-key' ) } ` ,
0 commit comments