title: Object "undefined" in Mocha script. Not sure how to pass on value
body: <p>I am running a mocha test on a bunch of endpoints and I'm not able to pass on results to the next test case
  Failing at line    <code>var result = data["results"];</code>
  <code>error:data undefined</code></p>
  
  <pre><code>
      it('should get series', async () =&gt; {
          let data = await legacy.getCategories(config[process.env.TEST_ENV].url, config[process.env.TEST_ENV].origin);
          console.log(data);
          expect(data).to.be.an('array').that.is.not.empty;
          done();
      });
  
      var unallowedGuids = config[process.env.TEST_ENV].unallowedGuids;
      var result = data["results"];
  
      for (i = 0; i &lt; result.length; i++) { 
          let guid = result[i]["guid"];
          let showName = result[i]["title"];
          if (!unallowedGuids.includes(guid)){
                  it('should get colletions guid', async () =&gt; {
                  let data = await legacy.collectionsGuid(config[process.env.TEST_ENV].url, config[process.env.TEST_ENV].origin, guid);
                  expect(data).to.be.an('array').that.is.not.empty;
                  done();
      });
                  it('should get series guid', async () =&gt; {
                  let data = await legacy.seriesGuid(config[process.env.TEST_ENV].url, config[process.env.TEST_ENV].origin, guid);
                  expect(data).to.be.an('array').that.is.not.empty;
                  done();
      });
          } 
          else
              console.log("excluded", guid);
      }
  
  });```
  </code></pre>