code: function(path) {
          let req = null;
          let i;
          let j;
          let matchingReq = null;
          let expectedReq = null;
          let testResponse = null;
          for (i = 0; i < this.requests.length; i++) {
              req = this.requests[i];
              for (j = 0; j < this.expectedRequests.length; j++) {
                  expectedReq = this.expectedRequests[j];
                  if (path && path !== expectedReq.path) {
                      continue;
                  }
                  if (expectedReq.method === req.method &&
                          req.path.indexOf(expectedReq.path) !== -1) {
                      if (!expectedReq.data || (JSON.stringify(expectedReq.data) ===
                              JSON.stringify(req.data))) {
                          matchingReq = expectedReq;
                          this.expectedRequests.splice(j, 1);
                          break;
                      }
                  }
              }
  
              if (matchingReq) {
                  // remove from request queue
                  this.requests.splice(i, 1);
                  i--;
  
                  for (j = 0; j < matchingReq.checks.length; j++) {
                      matchingReq.checks[j](req);
                  }
                  testResponse = matchingReq.response;
                  console.log(`${Date.now()}    responding to ${matchingReq.path}`);
  
                  let body = testResponse.body;
                  if (Object.prototype.toString.call(body) == "[object Function]") {
                      body = body(req.path, req.data, req);
                  }
  
                  if (!testResponse.rawBody) {
                      body = JSON.stringify(body);
                  }
                  req.callback(
                      testResponse.err, testResponse.response, body,
                  );
                  matchingReq = null;
              }
          }
          if (testResponse) {  // flushed something
              return true;
          }
          return false;
      }
docs: Attempts to resolve requests/expected requests.
  @param {string} path The path to flush (optional) default: all.
  @return {boolean} true if something was resolved.