title: Mocha - Running test ReferenceError: regeneratorRuntime is not defined
body: <p>I am trying to run tests with <code>async/await</code> using <code>mocha</code>. The project architecture was setup before I started working on it and I have been trying to update it's node version to 8.9.4. The project is an isomorphic application and uses babel, gulp and webpack to run.
  To run the tests we run a gulp task. There are two <code>.bablerc</code> files in the project. One in the root folder of the project and another in the test fodler.
  Both have the same configuration:</p>
  
  <pre><code>{
    "presets": [
      ["env", {"exclude": ["transform-regenerator"]}],
      "react",
      "stage-1"
    ],
    "plugins": [
      "babel-plugin-root-import"
    ]
  }
  </code></pre>
  
  <p>When I run the app locally there is no error returned anymore. However when I run the tests with <code>gulp test:api</code> I constantly get the error: <code>ReferenceError: regeneratorRuntime is not defined</code></p>
  
  <p>This is my gulp file in the test folder:</p>
  
  <pre><code>var gulp = require('gulp')
  var gutil = require('gulp-util')
  var gulpLoadPlugins = require('gulp-load-plugins')
  var plugins = gulpLoadPlugins()
  var babel = require('gulp-babel')
  
  
  require('babel-register')({
      presets:["es2015", "react", "stage-1"]
  });
  
  // This is a cheap way of getting 'test:browser' to run fully before 'test:api' kicks in.
  gulp.task('test', ['test:browser'], function(){
      return gulp.start('test:api')
  });
  
  gulp.task('test:api', function () {
      global.env = 'test'
      gulp.src(['test/unit-tests/server/**/*.spec.js'], {read: false})
          .pipe(plugins.mocha({reporter: 'spec'}))
          .once('error', function (error) {
              console.log(error)
              process.exit(1);
          })
          .once('end', function () {
              process.exit(0);
          })
  });
  
  gulp.task('default', ['test']);
  </code></pre>
  
  <p>Any help on why this is happening wouldd be much appreciated.</p>