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

SyntaxError: missing ) after argument list #3

Open
swatty007 opened this issue Aug 26, 2019 · 1 comment
Open

SyntaxError: missing ) after argument list #3

swatty007 opened this issue Aug 26, 2019 · 1 comment

Comments

@swatty007
Copy link

Hey
Im having some troubles to get this gem running.
I tried a couple of things and ended up at one point at the same spot as trusktr in ticket #1 that I could run the test but didnt got any output.

Hope somebody can help me to get some actual output.

I installed the package on a Windows 10 machine with node v8.12.0, yarn 1.17.3 and nwjs v0.40.1sdk set in windows path variable.

If I run yarn test I get the following error:

basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list

If I run the test command from jest directly like so:
node_modules/.bin/jest --env=jest-environment-node-nw

it fails on window is undefined instead.

FAIL  .\demonstration.test.js
  ● Test suite failed to run

    ReferenceError: window is not defined

Any idea whats missing on my end?

@tonetechnician
Copy link

tonetechnician commented Oct 29, 2019

Yep, I've also been getting this issue. This seems to be an issue with Windows and the jest.cmd. This issue is still open and it seems people have lost interest in trying to solve it.

I'm running a different version though:

node: 12.12.0
yarn: 1.19.1
nwjs: 0.42.0-sdk

One way to get past that error is to change the packages/tests/package.json file test command to

  "scripts": {
    "test": "node-nw ../node_modules/jest/bin/jest.js --env=jest-environment-node-nw --watch"
  },

But this results in further errors:

 FAIL  packages\tests\demonstration.test.js
  ● Test suite failed to run

    TypeError: Cannot set property 'console' of undefined

      at module.exports (node_modules\jest-util\build\setGlobal.js:17:37)

This is the same error I get when trying to run the jest.cmd directly as @swatty007 has done.

Trying to see if I can fix this as I really would love to get jest going in my nw app.

UPDATE:

So turns out that I was just referencing the wrong /bin/jest.js file by not using a double '../'. Noob work!

For clarity sake:

  1. Clone the repo
  2. yarn install
  3. Edit packages/tests/package.json script tag to:
  "scripts": {
    "test": "node-nw ../../node_modules/jest/bin/jest.js --env=jest-environment-node-nw --watch"
  },
  1. yarn test

And it all works.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants