@@ -88,7 +88,7 @@ describe('option encodeParams', () => {
88
88
...config ,
89
89
filterEndpoints : [ 'findPetsByStatus' ] ,
90
90
} ) ;
91
- expect ( api ) . toContain ( 'status: encodeURIComponent(queryArg.status)' ) ;
91
+ expect ( api ) . toContain ( 'status: encodeURIComponent(String( queryArg.status) )' ) ;
92
92
} ) ;
93
93
94
94
it ( 'should encode path parameters' , async ( ) => {
@@ -97,7 +97,7 @@ describe('option encodeParams', () => {
97
97
filterEndpoints : [ 'getOrderById' ] ,
98
98
} ) ;
99
99
// eslint-disable-next-line no-template-curly-in-string
100
- expect ( api ) . toContain ( '`/store/order/${encodeURIComponent(queryArg.orderId)}`' ) ;
100
+ expect ( api ) . toContain ( '`/store/order/${encodeURIComponent(String( queryArg.orderId) )}`' ) ;
101
101
} ) ;
102
102
103
103
it ( 'should not encode body parameters' , async ( ) => {
@@ -106,7 +106,7 @@ describe('option encodeParams', () => {
106
106
filterEndpoints : [ 'addPet' ] ,
107
107
} ) ;
108
108
expect ( api ) . toContain ( 'body: queryArg.pet' ) ;
109
- expect ( api ) . not . toContain ( 'body: encodeURIComponent(queryArg.pet)' ) ;
109
+ expect ( api ) . not . toContain ( 'body: encodeURIComponent(String( queryArg.pet) )' ) ;
110
110
} ) ;
111
111
112
112
it ( 'should work correctly with flattenArg option' , async ( ) => {
@@ -116,7 +116,7 @@ describe('option encodeParams', () => {
116
116
filterEndpoints : [ 'getOrderById' ] ,
117
117
} ) ;
118
118
// eslint-disable-next-line no-template-curly-in-string
119
- expect ( api ) . toContain ( '`/store/order/${encodeURIComponent(queryArg)}`' ) ;
119
+ expect ( api ) . toContain ( '`/store/order/${encodeURIComponent(String( queryArg) )}`' ) ;
120
120
} ) ;
121
121
122
122
it ( 'should not encode parameters when encodeParams is false' , async ( ) => {
0 commit comments