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

When running jest its says Syntax Error: Unexpected Identifier #8679

Closed
imskr opened this issue Jul 12, 2019 · 1 comment
Closed

When running jest its says Syntax Error: Unexpected Identifier #8679

imskr opened this issue Jul 12, 2019 · 1 comment

Comments

@imskr
Copy link

imskr commented Jul 12, 2019

🐛 Bug Report

Test suite failed to run
({"Object.":function(module,exports,require,__dirname,__filename,global,jest){import $ from 'jquery';
Syntax Error: Unexpected Identifier

To Reproduce

In package.json:

"jest": {
        "setupFiles": ["./source/setup-jest.js"]
 },

In source/setup-jest.js

import $ from 'jquery';
global.$ = global.jQuery = $;

Expected behavior

It should pass the test run but it is showing syntax error

Run npx envinfo --preset jest

System:
OS: Linux 4.15 elementary OS 5.0 Juno
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 10.16.0 - /usr/local/bin/node
npm: 6.9.0 - /usr/local/bin/npm
npmPackages:
jest: ^24.8.0 => 24.8.0

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant