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

Jest debug on Windows: SyntaxError: missing ) after argument list #3750

Closed
mikeumus opened this issue Jun 6, 2017 · 9 comments
Closed

Jest debug on Windows: SyntaxError: missing ) after argument list #3750

mikeumus opened this issue Jun 6, 2017 · 9 comments
Labels

Comments

@mikeumus
Copy link

mikeumus commented Jun 6, 2017

Do you want to request a feature or report a bug?
Report bug

What is the current behavior?
On Windows 7 Pro:

$ node --debug-brk ./node_modules/.bin/jest --runInBand
Debugger listening on [::]:5858
C:\home\ng2\cis-dashboard\web-api\frontend\node_modules\.bin\jest:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Timeout.Module.runMain [as _onTimeout] (module.js:604:10)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)

What is the expected behavior?
Jest to run in node debugger.

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Windows 7 Pro
jest v20.0.4
jest-preset-angular v2.0.2

Istanbul had a similar issue on Windows:

@charpeni
Copy link
Contributor

On Windows you can run it by the path instead of bin :

node --debug-brk ./node_modules/jest/bin/jest.js --runInBand

@ScottyEfird
Copy link

@charpeni That fix worked for me (Windows 10) after I first removed --debug-brk. Thanks.

@bestander
Copy link
Contributor

bestander commented Aug 1, 2017

I'll reopen the issue because the underlying one seems to not have been fixed.
Any ideas why .bin/jest is broken on Windows?

@bestander bestander reopened this Aug 1, 2017
@mnmkng
Copy link

mnmkng commented Aug 16, 2017

I reckon it has to do with Jest using Istanbul and this being an issue of Istanbul:

https://github.com/gotwarlost/istanbul#usage-on-windows

@adrian-moisa
Copy link

adrian-moisa commented Apr 22, 2018

The command seems to run. I use node Inspector Manager to open automatically the debugger. However, I see no output in there.

Edit
Found an anwser here: https://stackoverflow.com/a/39641938/1903781

cheshire137 added a commit to cheshire137/competiwatch-desktop that referenced this issue Sep 1, 2018
See similar problem in jestjs/jest#3750 (comment), was getting

> SyntaxError: missing ) after argument list
@dougajmcdonald
Copy link

dougajmcdonald commented Feb 14, 2019

My 2c on windows:

node --inspect ./node_modules/jest-cli/bin/jest.js --runInBand --watch /src/tests/

is working for me, note jest-cli in the path

@SimenB
Copy link
Member

SimenB commented Feb 14, 2019

I don't think this is jest's fault. On windows in cmd, you need to run node_modules/.bin/jest.cmd - that's how bin works.

image

To pass flags, use NODE_OPTIONS

@antgonzales
Copy link

I don't think this strictly a windows issue:
https://share.getcloudapp.com/YEudr74D

@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.
Labels
Projects
None yet
Development

No branches or pull requests

10 participants