Skip to content
New issue

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

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

Already on GitHub? # to your account

After run detox test getting Device.js Unexpected token ... #663

Closed
maciekstosio opened this issue Apr 9, 2018 · 7 comments
Closed

After run detox test getting Device.js Unexpected token ... #663

maciekstosio opened this issue Apr 9, 2018 · 7 comments

Comments

@maciekstosio
Copy link

maciekstosio commented Apr 9, 2018

Description

I'm following this guide and I ran into an error. I've ran detox build (and it succeeded) and then detox test which error:

/node_modules/detox/src/devices/Device.js:91
        await this.deviceDriver.deliverPayload({...params, delayPayload: true});
                                                ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)

Steps to Reproduce

Go to CLI and run detox build & detox test

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.3.3
  • React Native:0.51.0
  • Node: 7.7.3
  • Device: iPhone 7
  • Xcode: 9.1
  • macOS: 10.12.6

Device and verbose Detox logs

        await this.deviceDriver.deliverPayload({...params, delayPayload: true});
                                                ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/macieks/Documents/magenes-mobile/node_modules/detox/src/Detox.js:2:16)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/macieks/Documents/magenes-mobile/node_modules/detox/src/index.js:1:77)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/macieks/Documents/magenes-mobile/e2e/init.js:1:77)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at /Users/macieks/Documents/magenes-mobile/node_modules/mocha/lib/mocha.js:231:27
    at Array.forEach (native)
    at Mocha.loadFiles (/Users/macieks/Documents/magenes-mobile/node_modules/mocha/lib/mocha.js:228:14)
    at Mocha.run (/Users/macieks/Documents/magenes-mobile/node_modules/mocha/lib/mocha.js:536:10)
    at Object.<anonymous> (/Users/macieks/Documents/magenes-mobile/node_modules/mocha/bin/_mocha:582:18)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:425:7)
    at startup (bootstrap_node.js:146:9)
    at bootstrap_node.js:540:3
child_process.js:532
    throw err;
    ^

Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.sim.debug --loglevel verbose    --grep :android: --invert
    at checkExecSyncError (child_process.js:489:13)
    at Object.execSync (child_process.js:529:13)
    at runMocha (/Users/macieks/Documents/magenes-mobile/node_modules/detox/local-cli/detox-test.js:102:6)
    at run (/Users/macieks/Documents/magenes-mobile/node_modules/detox/local-cli/detox-test.js:64:7)
    at Object.<anonymous> (/Users/macieks/Documents/magenes-mobile/node_modules/detox/local-cli/detox-test.js:54:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
@maciekstosio maciekstosio changed the title After tun detox test getting Device.js Unexpected token ... After run detox test getting Device.js Unexpected token ... Apr 9, 2018
@LeoNatan
Copy link
Contributor

LeoNatan commented Apr 9, 2018

Any reason you are using such an old Node version (7.x)?

Upgrading to 8.6 will fix your issue.

I ask because we are considering bumping the Node requirement.

@maciekstosio
Copy link
Author

Yes, it seems to work. I've seen 7.6 requirement in docs and i thought it will be enough. I have another issue, but I'm not sure if it's right place to ask.
My apps works that I have login page at the beginning, and after logging in there is screen that indicate data loading (downloading data in) and then it goes to dashboard. I've put id on main view of this loading screen and tried to check weather it shows after successful log in, but it doesn't detect it. Downloading data takes ~30sec so I'm wondering why it doesn't "see" it. Can it be caused by loading data?

@LeoNatan
Copy link
Contributor

We synchronize on network, so yes, probably.

@LeoNatan
Copy link
Contributor

@rotemmiz Let's bump the Node requirement.

@noomorph
Copy link
Collaborator

noomorph commented Jul 3, 2018

I think it's perfectly valid to close this issue as the 62da778 has been merged already.

@noomorph noomorph closed this as completed Jul 3, 2018
@lochness42
Copy link

I'm seeing same issue with Node v8.2.1 and Detox 8.0.0
Any suggestions what to do with this?

@noomorph
Copy link
Collaborator

noomorph commented Jul 22, 2018

Node v8.2.1

That's the problem. Come on, update to the normal Node v8.11.3 LTS.

The minimal requirement is: 8.3.0 See: 62da778#diff-d14d4a53aa4b327c46010adaa7ce8538R56

@wix wix locked as resolved and limited conversation to collaborators Jul 22, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

5 participants