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

CLI: detox test fails to determine a default configuration #648

Closed
askielboe opened this issue Mar 28, 2018 · 1 comment
Closed

CLI: detox test fails to determine a default configuration #648

askielboe opened this issue Mar 28, 2018 · 1 comment

Comments

@askielboe
Copy link
Contributor

askielboe commented Mar 28, 2018

Seems you now have to specify the configuration manually (e.g. detox test -c ios.sim.debug), otherwise detox test crashes.

Description

After upgrading to detox 7.3.X, detox test fails with the following error:

/Users/askielboe/rntest/MyProject/node_modules/detox/local-cli/detox-test.js:37
const platform = (config.configurations[program.configuration].type).split('.')[0];
                                                               ^

TypeError: Cannot read property 'type' of undefined
    at Object.<anonymous> (/Users/askielboe/rntest/MyProject/node_modules/detox/local-cli/detox-test.js:37:64)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Function.Module.runMain (module.js:690:10)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:666:3

It seems that program.configuration is undefined (unsurprisingly?). Setting the configuration using detox test -c ios.sim.debug makes detox test work again.

Steps to Reproduce

  1. react-native init MyProject
  2. Build using Xcode
  3. yarn global add detox-cli
  4. yarn add detox --dev
  5. yarn add mocha --dev
  6. Add detox config from Getting Started to package.json, replacing "example" with "MyProject"
  7. detox init
  8. detox build
  9. detox test

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.3.2
  • React Native: 0.54.3
  • Node: 9.8.0
  • Device: iPhone 7
  • Xcode: 9.2 (9C40b)
  • macOS: 10.13.3 (17D102)

Device and verbose Detox logs

See error log above.

@rotemmiz
Copy link
Member

Thanks for reporting, this is indeed an issue caused by #639.

A workaround for this (till we publish a fix) would be to explicitly select a configuration:
detox test -c myConfiguration

@rotemmiz rotemmiz changed the title detox test fails because program.configuration is undefined CLI: detox test fails to determine a default configuration Mar 28, 2018
rotemmiz added a commit that referenced this issue Mar 28, 2018
yershalom pushed a commit that referenced this issue Apr 4, 2018
@wix wix locked and limited conversation to collaborators Jul 23, 2018
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

3 participants