samedi 21 mai 2016

Testing with Mocha & es6: Unexpected token "import"

I'm trying to run client-side tests for React reducers using Mocha & Chai and Mocha/Node is complaining about any kind of es6, specifically "import" and "export" statements.

Unexpected token import

Here is my .babelrc file:

{
    "presets": ["es2015", "stage-0", "react"]
}

I also tried installing babel-core and using the method specified in this stackoverflow article: (Babel unexpected token import when running mocha tests)

I am running node version 5.5.0, not sure if that helps. Let me know if I can provide any more info. Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire