Friday 5 May 2017

AVA Test Runner Setup with Create React App Boilerplate

Trying to setup AVA after running create-react-app. There are a few tutorials and references of this gist I've found and tried, but I keep getting an unexpected token error on the JSX <App /> element. Anyone know what is wrong with that gist? Full output of npm run test:

react-with-ava@0.1.0 test /react-with-ava
cross-env NODE_ENV=test ava

1 exception

Uncaught Exception
SyntaxError: /react-with-ava/src/App.test.js: Unexpected token (8:18)
SyntaxError: /react-with-ava/src/App.test.js: Unexpected token (8:18)
6 | test('renders without crashing', t => {
7 |   const div = document.createElement('div');
8 |   ReactDOM.render(<App />, div);
  |                   ^
9 | });



via ocergynohtna

No comments:

Post a Comment