ES6 Mocha - 语法错误

时间:2016-06-01 15:53:10

标签: react-native ecmascript-6 mocha

我使用ES6编写了一个react-native应用程序并使用Mocha进行测试,但是在运行测试时遇到了基本的语法错误。我的import语法似乎没问题,但是我在我的依赖项https://github.com/APSL/react-native-buttonconst {会窒息。

我的代码: import Button from 'apsl-react-native-button';

这是我的错误:

SyntaxError: Unexpected token {

来自我的依赖的代码: const React = require('react'); const { PropTypes } = React;

最后我的mocha.opts --compilers js:babel-core/register --require react-native-mock/mock --require babel-polyfill --reporter spec --recursive

0 个答案:

没有答案