title: Export variable in Mocha test
body: <p>To shed some light on what i'm trying to do is: after the test below is ran I get the <code>report.json</code> generated and the token I generated in the before hook and send the report to another api for it to process.</p>
  
  <p>I have a mocha test in which I generate a token and I need this token generate to be shared with another js file. </p>
  
  <pre><code>var token = 'un_assigned';
  
  describe('Comparison', function () {
    token = 'sin asignar';
    before(function (done) {
      getToken('app', function (response) {
        token = response.token;
        done();
      })
    });
  
    files.forEach(function (file) {
      it('Comparing ' + file, function (done) {
        const id = file.split('./screenshots/')[1];
        compare(file, id, token, function (response) {
          expect(response.TestPassed).to.be.true;
          done();
        });
      });
    });
  
    after(function (done) {
      done();
  
    })
  });
  
  
  exports.tokenApi = function getToken(){
    console.log(token);
    return token;
  };
  </code></pre>
  
  <p>After the test is ran I need to pass the generate token to another JS file so I can process the mocha report. I tried using exports but when I call my function it calls my test. I'm a JS noob is there something im missing ?.</p>