@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labdigital/commercetools-mock",
3
- "version": "2.43.1",
3
+ "version": "2.43.3",
4
4
  "license": "MIT",
5
5
  "author": "Michael van Tellingen",
6
6
  "type": "module",
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
- server.use(
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() {