msw 0.45.0 → 0.46.0

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.
@@ -1225,6 +1225,13 @@ function pipeEvents(source, destination) {
1225
1225
  source.emit._isPiped = true;
1226
1226
  }
1227
1227
 
1228
+ // src/utils/internal/toReadonlyArray.ts
1229
+ function toReadonlyArray(source) {
1230
+ const clone = [...source];
1231
+ Object.freeze(clone);
1232
+ return clone;
1233
+ }
1234
+
1228
1235
  // src/node/createSetupServer.ts
1229
1236
  var DEFAULT_LISTEN_OPTIONS = {
1230
1237
  onUnhandledRequest: "warn"
@@ -1296,8 +1303,12 @@ function createSetupServer(...interceptors) {
1296
1303
  resetHandlers(...nextHandlers) {
1297
1304
  currentHandlers = resetHandlers(requestHandlers, ...nextHandlers);
1298
1305
  },
1306
+ listHandlers() {
1307
+ return toReadonlyArray(currentHandlers);
1308
+ },
1299
1309
  printHandlers() {
1300
- currentHandlers.forEach((handler) => {
1310
+ const handlers = this.listHandlers();
1311
+ handlers.forEach((handler) => {
1301
1312
  const { header, callFrame } = handler.info;
1302
1313
  const pragma = handler.info.hasOwnProperty("operationType") ? "[graphql]" : "[rest]";
1303
1314
  console.log(`${bold(`${pragma} ${header}`)}