Skip to content

out-of-the-box Visual Studio Code unexpected token when testing #2709

Closed
jest-community/vscode-jest
#162
@afontcu

Description

@afontcu

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes, tried with v4 and v5 as well.

Which terms did you search for in User Guide?

visual studio code jest, jest testing, code testing integration

Environment

  1. node -v: v6.10.3

  2. npm -v: 4.6.1

  3. npm ls react-scripts (if you haven’t ejected): 1.0.10

  4. Operating system: MacOS

Steps to Reproduce

  1. install create-react-app
  2. install jest extension for Visual Studio Code (the recommended one)
  3. reload it and try to debug

Expected Behavior

Pass the tests (as it does in CLI)

Actual Behavior

 FAIL  src/App.test.js

  ● Test suite failed to run

    .../src/App.test.js: Unexpected token (7:18)
        5 | it('renders without crashing', () => {
        6 |   const div = document.createElement('div');
      > 7 |   ReactDOM.render(<App />, div);
          |                   ^
        8 | });
        9 | 

Reproducible Demo

DNA.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions