0

I'm trying to add some tests to an app I'm building and I found a problem that's blocking me.

This is the code:

import React from 'react';
test('Should render Loading correctly', () => {
});

And below you'll find the error:

● Test suite failed to run

    /home/tul1/Desktop/proyectos/inorbit/web/tests/components/Loading.test.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import React from 'react';
                                                                                             ^^^^^^

    SyntaxError: Unexpected token import

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.119s
Ran all test suites related to changed files.

I'm using Meteor for the app and react 15.6.2. I've installed jest jest-babel and react-test-renderer@16.5.2 .

Does anybody know what the problem could be and how to solve it?

skyboyer
  • 22,209
  • 7
  • 57
  • 64
tul1
  • 412
  • 1
  • 6
  • 22

0 Answers0