File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
packages/utils/testing/src Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -147,21 +147,22 @@ class PluginsMock {
147
147
const apiFn = this . plugins . plugin . apiCalls [ index ] ;
148
148
assert ( apiFn , `API call for '${ method } ${ endpoint } ' wanted, but not registered` ) ;
149
149
150
- let req ;
150
+ let req = { } ;
151
151
if ( [ "GET" , "DELETE" ] . includes ( method . toUpperCase ( ) ) ) {
152
- req = {
153
- query : params
154
- } ;
152
+ if ( params && params . params ) {
153
+ req . params = params . params ;
154
+ }
155
+ req . query = params ;
155
156
} else {
156
157
req = {
157
158
body : params
158
159
} ;
159
160
}
160
161
const resp = {
161
- send : sinon . spy ( ) ,
162
- status : sinon . spy ( )
162
+ send : sinon . spy ( )
163
163
} ;
164
- apiFn ( req , resp ) ;
164
+
165
+ resp . status = sinon . fake . returns ( resp ) ;
165
166
return resp ;
166
167
}
167
168
}
You can’t perform that action at this time.
0 commit comments