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

node issue #3313

Closed
Sigura opened this issue Jan 3, 2017 · 6 comments
Closed

node issue #3313

Sigura opened this issue Jan 3, 2017 · 6 comments

Comments

@Sigura
Copy link

Sigura commented Jan 3, 2017

osx
node 4.7

> $ mocha ./test/checklist.js
/Users/sigura/work/taxlien/taxliencloud/app/node_modules/selenium-webdriver/index.js:115
  static createSession(...args) {}
                       ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Module._extensions..js (module.js:416:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/sigura/work/taxlien/taxliencloud/app/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/sigura/work/taxlien/taxliencloud/app/test/checklist.js:2:1)
    at Module._compile (module.js:409:26)
    at loader (/Users/sigura/work/taxlien/taxliencloud/app/node_modules/babel-register/lib/node.js:144:5)

same result with mocha --require ./server.babel.js --require babel-polyfill --compilers js:babel-register ./test/checklist.js

tried run dummy test mocha ./test/del-me.js:

class Test {
  static createSession(...args) {
    console.log(args);
  }
}

describe('Main workflow', () => {
  Test.createSession(1, 2, 3)
});

works fine

@Sigura
Copy link
Author

Sigura commented Jan 3, 2017

works correct only on node@7

@Sigura
Copy link
Author

Sigura commented Jan 3, 2017

solved by adding:

"ignore": false,

to babel config

@AutomatedTester
Copy link
Member

closing since this was solved by user

@trotzig
Copy link

trotzig commented Jan 7, 2017

Could this be a real issue after all? selenium-webdriver claims to support Node 4 and up, yet it is using rest parameters which isn't supported by default in Node 4 and 5 (if I'm not mistaken). I'm getting errors in Node v4 and v5 (but not v6 and v7) when running a jest test with selenium-webdriver 3.0.1:

 SyntaxError: Unexpected token ...
      
      at transformAndBuildScript (node_modules/jest/node_modules/jest-cli/node_modules/jest-runtime/build/transform.js:320:12)
      at Object.<anonymous> (node_modules/selenium-webdriver/http/index.js:29:17)
      at Object.<anonymous> (node_modules/selenium-webdriver/firefox/index.js:119:12)

I believe this is coming from

function toExecuteAtomCommand(command, atom, ...params) {

It looks like Node 4 and 5 do support rest parameters, but only with the --harmony flag.

@jleyba
Copy link
Contributor

jleyba commented Jan 7, 2017

As of 3.0, selenium-webdriver requires node 6.9 or newer.

@trotzig
Copy link

trotzig commented Jan 8, 2017

I see. I just re-read the docs, and even though they are a little confusing it's stated that LTS (6.9.1) and stable (7 something) are the only supported versions. Makes sense, thanks for clarifying @jleyba!

trotzig added a commit to Galooshi/happo that referenced this issue Jan 9, 2017
With selenium-webdriver now only supporting 6.9.1 (LTS) and v7 [1], we
can't continue supporting Node 4 and 5.

I made a (270d66c) few (59c6e3b) attempts (510262a) at getting
things working, but none proved to help us out.

[1]: SeleniumHQ/selenium#3313
@lock lock bot locked and limited conversation to collaborators Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants