@labdigital/commercetools-mock 2.43.0 → 2.43.2

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 CHANGED
@@ -590,9 +590,6 @@ var import_deep_equal = __toESM(require("deep-equal"), 1);
590
590
  // src/repositories/errors.ts
591
591
  var checkConcurrentModification = (currentVersion, expectedVersion, identifier) => {
592
592
  if (currentVersion === expectedVersion) return;
593
- console.error(
594
- `Object ${identifier} has a different version than expected. Expected: ${expectedVersion} - Actual: ${currentVersion}.`
595
- );
596
593
  throw new CommercetoolsError(
597
594
  {
598
595
  message: `Object ${identifier} has a different version than expected. Expected: ${expectedVersion} - Actual: ${currentVersion}.`,
@@ -9370,8 +9367,12 @@ var CommercetoolsMock = class {
9370
9367
  // allows you to manage msw server yourself and register the handlers needed
9371
9368
  // for commercetools-mock to work.
9372
9369
  registerHandlers(server) {
9370
+ const handlers = this.getHandlers(server);
9371
+ server.use(...handlers);
9372
+ }
9373
+ getHandlers(server) {
9373
9374
  const app = this.app;
9374
- server.use(
9375
+ return [
9375
9376
  import_msw.http.post(`${this.options.authHost}/oauth/*`, async ({ request }) => {
9376
9377
  const body = await request.text();
9377
9378
  const url = new URL(request.url);
@@ -9430,7 +9431,7 @@ var CommercetoolsMock = class {
9430
9431
  headers: mapHeaderType(res.headers)
9431
9432
  });
9432
9433
  })
9433
- );
9434
+ ];
9434
9435
  }
9435
9436
  mswServer() {
9436
9437
  return this._mswServer;