11import packageJson from '../../package.json' ;
2- import { getBaseAxiosConfig , MonkAPIConfig , sdkVersion } from '../../src/api/config' ;
2+ import { getKyConfig , MonkAPIConfig , sdkVersion } from '../../src/api/config' ;
33
44describe ( 'Network package API global config utils' , ( ) => {
55 describe ( 'sdkVersion global constant' , ( ) => {
@@ -8,30 +8,30 @@ describe('Network package API global config utils', () => {
88 } ) ;
99 } ) ;
1010
11- describe ( 'getBaseAxiosConfig function' , ( ) => {
11+ describe ( 'getKyConfig function' , ( ) => {
1212 const baseConfig : MonkAPIConfig = {
1313 apiDomain : 'testapidomain' ,
1414 authToken : 'Bearer testtoken' ,
1515 } ;
1616
1717 it ( 'should set the baseURL property' , ( ) => {
18- expect ( getBaseAxiosConfig ( baseConfig ) ) . toEqual (
18+ expect ( getKyConfig ( baseConfig ) ) . toEqual (
1919 expect . objectContaining ( {
20- baseURL : `https://${ baseConfig . apiDomain } ` ,
20+ baseUrl : `https://${ baseConfig . apiDomain } ` ,
2121 } ) ,
2222 ) ;
2323 } ) ;
2424
2525 it ( 'should remove the ending slash from the baseURL property' , ( ) => {
26- expect ( getBaseAxiosConfig ( { ...baseConfig , apiDomain : `${ baseConfig . apiDomain } /` } ) ) . toEqual (
26+ expect ( getKyConfig ( { ...baseConfig , apiDomain : `${ baseConfig . apiDomain } /` } ) ) . toEqual (
2727 expect . objectContaining ( {
28- baseURL : `https://${ baseConfig . apiDomain } ` ,
28+ baseUrl : `https://${ baseConfig . apiDomain } ` ,
2929 } ) ,
3030 ) ;
3131 } ) ;
3232
3333 it ( 'should set the Access-Control-Allow-Origin header' , ( ) => {
34- expect ( getBaseAxiosConfig ( baseConfig ) ) . toEqual (
34+ expect ( getKyConfig ( baseConfig ) ) . toEqual (
3535 expect . objectContaining ( {
3636 headers : expect . objectContaining ( {
3737 'Access-Control-Allow-Origin' : '*' ,
@@ -41,7 +41,7 @@ describe('Network package API global config utils', () => {
4141 } ) ;
4242
4343 it ( 'should set the Authorization header' , ( ) => {
44- expect ( getBaseAxiosConfig ( baseConfig ) ) . toEqual (
44+ expect ( getKyConfig ( baseConfig ) ) . toEqual (
4545 expect . objectContaining ( {
4646 headers : expect . objectContaining ( {
4747 Authorization : baseConfig . authToken ,
@@ -52,7 +52,7 @@ describe('Network package API global config utils', () => {
5252
5353 it ( 'should add the "Bearer " prefix to the token if it is missing' , ( ) => {
5454 const authToken = 'testtokentest' ;
55- expect ( getBaseAxiosConfig ( { ...baseConfig , authToken } ) ) . toEqual (
55+ expect ( getKyConfig ( { ...baseConfig , authToken } ) ) . toEqual (
5656 expect . objectContaining ( {
5757 headers : expect . objectContaining ( {
5858 Authorization : `Bearer ${ authToken } ` ,
@@ -62,7 +62,7 @@ describe('Network package API global config utils', () => {
6262 } ) ;
6363
6464 it ( 'should set the X-Monk-SDK-Version header' , ( ) => {
65- expect ( getBaseAxiosConfig ( baseConfig ) ) . toEqual (
65+ expect ( getKyConfig ( baseConfig ) ) . toEqual (
6666 expect . objectContaining ( {
6767 headers : expect . objectContaining ( {
6868 'X-Monk-SDK-Version' : packageJson . version ,
0 commit comments