BUPKIS
    Preparing search index...

    Function waitForBodies

    • Waits for all tracked request bodies to be parsed and returns the requests.

      Use this when you need to access req.body directly. For body assertions, prefer using expectAsync which handles this automatically.

      Parameters

      Returns Promise<TrackedRequest[]>

      Promise resolving to tracked requests with bodies parsed

      await fetch(url, {
      method: 'POST',
      body: JSON.stringify({ name: 'Bob' }),
      });
      const requests = await waitForBodies(server);
      console.log(requests[0].body); // { name: 'Bob' }