@labdigital/commercetools-mock 2.43.1 → 2.43.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ctMock.ts +7 -2
package/package.json
CHANGED
package/src/ctMock.ts
CHANGED
|
@@ -197,8 +197,13 @@ export class CommercetoolsMock {
|
|
|
197
197
|
// allows you to manage msw server yourself and register the handlers needed
|
|
198
198
|
// for commercetools-mock to work.
|
|
199
199
|
public registerHandlers(server: SetupServerApi) {
|
|
200
|
+
const handlers = this.getHandlers();
|
|
201
|
+
server.use(...handlers);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
public getHandlers() {
|
|
200
205
|
const app = this.app;
|
|
201
|
-
|
|
206
|
+
return [
|
|
202
207
|
http.post(`${this.options.authHost}/oauth/*`, async ({ request }) => {
|
|
203
208
|
const body = await request.text();
|
|
204
209
|
const url = new URL(request.url);
|
|
@@ -290,7 +295,7 @@ export class CommercetoolsMock {
|
|
|
290
295
|
headers: mapHeaderType(res.headers),
|
|
291
296
|
});
|
|
292
297
|
}),
|
|
293
|
-
|
|
298
|
+
];
|
|
294
299
|
}
|
|
295
300
|
|
|
296
301
|
public mswServer() {
|