title: Trying to setup tests with mocha, babel & es6 modules
body: <p>I'm trying to leverage grunt &amp; babel to load my es6 source as a dependency for the given test. So i've been running the actual src and compiling the app just fine via browserify:</p>
  
  <pre><code>module.exports = function (grunt) {
  
    // Import dependencies
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-browserify');
  
    grunt.initConfig({
      browserify: {
        dist: {
          files: {
            'www/js/bundle.js': ['src/app.js'],
          },
          options: {
            transform: [['babelify', { optional: ['runtime'] }]],
            browserifyOptions: {
              debug: true
            }
          }
        }
      },
      jshint : {
        options : {
          jshintrc : ".jshintrc",
        },
  
        dist: {
          files: {
            src: ["src/**/*.js"]
          }
        }
      },
      watch: {
        scripts: {
          files: ['src/**/*.js'],
          tasks: ['jshint', 'browserify'],
          options: {
            atBegin: true,
            spawn: true
          },
        },
      }
    });
  
    grunt.registerTask("default", ['watch']);
  
  };
  </code></pre>
  
  <p>It compiles a single bundle.js file, which i include in my index.html file. Great!</p>
  
  <p>So what I want to do from the tests, is import the file i'm testing. So i have a simple storage object called InteractionStore, locationed in <code>src/stores/interaction_store.js</code>. Then i have created a spec file at: <code>test/stores/interaction_store_spec.js</code></p>
  
  <pre><code>import expect from "expect.js";
  import InteractionStore from '../../../src/stores/interaction_store.js';
  
  describe("InteractionStore", () =&gt; {
    beforeEach(() =&gt; {
      InteractionStore.data = [];
    });
    describe("#start()", () =&gt; {
      it ("should apped multiple", function () {
        InteractionStore.start();
        InteractionStore.start();
        InteractionStore.start();
        expect(InteractionStore.data.length).toEqual(3);
      });
    });
  });
  </code></pre>
  
  <p>So i import the store directly. I've added a few sections to the grunt file for the test process:</p>
  
  <pre><code>module.exports = function (grunt) {
  
    // Import dependencies
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-mocha-test');
    grunt.loadNpmTasks('grunt-babel');
  
    grunt.initConfig({
      babel: {
        options: {
          sourceMap: true,
          modules: "common"
        },
        test: {
          files: [{
            expand: true,
            cwd: 'test',
            src: ['**/*.js'],
            dest: 'test/compiled_specs',
            ext:'.js'
          }]
        }
      },
      browserify: {
        dist: {
          files: {
            'www/js/bundle.js': ['src/app.js'],
          },
          options: {
            transform: [['babelify', { optional: ['runtime'] }]],
            browserifyOptions: {
              debug: true
            }
          }
        }
      },
      clean: ["test/compiled_specs"],
      jshint : {
        options : {
          jshintrc : ".jshintrc",
        },
  
        dist: {
          files: {
            src: ["src/**/*.js"]
          }
        }
      },
      watch: {
        scripts: {
          files: ['src/**/*.js'],
          tasks: ['jshint', 'browserify:dist'],
          options: {
            atBegin: true,
            spawn: true
          },
        },
      },
  
      mochaTest: {
        test: {
          src: ['test/compiled_specs/**/*_spec.js']
        }
      }
    });
  
    grunt.registerTask("default", ['watch']);
    grunt.registerTask("test", ['clean', 'babel', 'mochaTest']);
  
  };
  </code></pre>
  
  <p>Babel compiles the tests no problem, but then when i run it, it loads the .js files in the src folder that are in es6 still, and naturally it explodes.</p>