Skip to content
This repository has been archived by the owner on Oct 10, 2021. It is now read-only.

How to use ES6 syntax with zuul test framework #292

Open
daveashworth opened this issue Jul 7, 2016 · 4 comments
Open

How to use ES6 syntax with zuul test framework #292

daveashworth opened this issue Jul 7, 2016 · 4 comments

Comments

@daveashworth
Copy link

Using mocha as my test framework, in my mocha.opts file I have the following option to tell mocha to use babel as the compiler:

--compilers js:babel-core/register

In my test file, my first line is:

import React from "react";

And when I run zuul with this test, I see the following output in the console:

import React from "react";
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Can someone please point me to where I setup zuul to use babel to make this work properly?

@daveashworth
Copy link
Author

it looks like you can do this for browserify, but our projects use webpack...

browserify:
  - transform:
      name: babelify

Is there another way?

@vvo
Copy link
Collaborator

vvo commented Jul 7, 2016

@daveashworth not sure zuul is picking mocha.opts, you should ensure it's reading it first

@daveashworth
Copy link
Author

@vvo: is zuul supposed to pick up mocha.opts? That would be nice if so. I didn't mean to imply that I thought it would, only showing that for mocha there is an option to specify compilers. I was hoping there was the same for zuul. I'm currently using zuul-builder-webpack to achieve similar results, but was hoping for something built into zuul.

@vvo
Copy link
Collaborator

vvo commented Jul 8, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants