function pruneExpectedNetworkRequests(testDefns, takeNetworkRequestUrls) {
  const pruneNetworkRequests = !takeNetworkRequestUrls;

  const clonedDefns = cloneDeep(testDefns);
  for (const {id, expectations, runSerially} of clonedDefns) {
    if (!runSerially && expectations.networkRequests) {
      throw new Error(`'${id}' must be set to 'runSerially: true' to assert 'networkRequests'`);
    }

    if (pruneNetworkRequests && expectations.networkRequests) {
      // eslint-disable-next-line max-len
      const msg = `'networkRequests' cannot be asserted in test '${id}'. They should only be asserted on tests from an in-process server`;
      if (process.env.CI) {
        // If we're in CI, we require any networkRequests expectations to be asserted.
        throw new Error(msg);
      }

      console.warn(log.redify('Warning:'),
          `${msg}. Pruning expectation: ${JSON.stringify(expectations.networkRequests)}`);
      expectations.networkRequests = undefined;
    }
  }

  return clonedDefns;
}
Prune the `networkRequests` from the test expectations when `takeNetworkRequestUrls`
is not defined. Custom servers may not have this method available in-process.
Also asserts that any expectation with `networkRequests` is run serially. For core
tests, we don't currently have a good way to map requests to test definitions if
the tests are run in parallel.
@param {Array<Smokehouse.TestDfn>} testDefns
@param {Function|undefined} takeNetworkRequestUrls
@return {Array<Smokehouse.TestDfn>}