mardi 10 juillet 2018

Jest Unexpected identifier: React

When I try to execute a test on reactjs with jest, it always return me the error: I have correctly install Jest, I have try to remove import but it do an error with the next.

App.test.js:

import React from 'react';
import {shallow }from 'enzyme';
import renderer from 'react-test-renderer';
import ReactDOM from 'react-dom';
import App from './App.js';
import User from './Modules/User.js';

const user = {
    email: "test@gmail.com",
    first_name: "test",
    last_name: "test"
}

test('Users renders properly', () => {
  const wrapper = shallow("<User users={user}/>");
  const element = wrapper.find('input');
});

Feel free to ask for more detail.

Aucun commentaire:

Enregistrer un commentaire