i wrote test_helper for testing my react components but every time i hit npm start
and following errors come out.
> jsonplaceholder-client@0.0.1 test /Users/WOOJUNG/Desktop/jsonplaceholder-client
> mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive ./test
/Users/WOOJUNG/Desktop/jsonplaceholder-client/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/index.js:573
throw err;
^
SyntaxError: /Users/WOOJUNG/Desktop/jsonplaceholder-client/test/test_helper.js: Unexpected token (21:4)
19 | function renderComponent(ComponentClass, props = {}, state = {}) {
20 | const componentInstance = TestUtils.renderIntoDocument(
> 21 | <Provider store={createStore(reducers, state)}>
| ^
22 | <ComponentClass {...props} />
23 | </Provider>
24 | );
it seems like error occurs because of failed compile test_helper
. I'm not sure but as I know js:babel-core/register
can compile es6 but it fails. should I give another options to compile test_helper
? but I have no idea. T_ T
Aucun commentaire:
Enregistrer un commentaire