Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
afontcu opened this issue Jul 1, 2017 · 2 comments · Fixed by jest-community/vscode-jest#162
Closed

Comments

@afontcu
Copy link

afontcu commented Jul 1, 2017

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!

@gaearon
Copy link
Contributor

gaearon commented Jul 1, 2017

Please file this with https://github.com/orta/vscode-jest.
Unfortunately there’s nothing we can do on our side to fix this.

I believe @orta has fixed this at some point in the past but the integration might have broken again. I don’t know enough about how it works to suggest anything.

Thanks!

@gaearon gaearon closed this as completed Jul 1, 2017
@gaearon
Copy link
Contributor

gaearon commented Jul 1, 2017

This might be related jest-community/vscode-jest#113

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
legend1202 pushed a commit to legend1202/vscode-jest that referenced this issue Jun 18, 2023
When a project is bootstrapped with create-react-app using the latest
versions of node/npm, the react-scripts executable is installed in the
top level node_modules/.bin directory. This has been added as the first
path to check.

This fixes jest-community#161, closes jest-community#39, closes jest-community#113 and resolves facebook/create-react-app#2709, and closes jest-community#125.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants