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

point to a single configuration file #901

Closed
oreporan opened this issue Aug 27, 2018 · 8 comments · Fixed by #2050
Closed

point to a single configuration file #901

oreporan opened this issue Aug 27, 2018 · 8 comments · Fixed by #2050

Comments

@oreporan
Copy link
Contributor

Description

Currently it seems that detox allows configuring only in the package.json of the project. But using a mono-repo (lerna), we want to run detox in specific packages. However I don't want to duplicate our detox config in each package.json
I've seen a discussion in #175 but it doesn't mention creating the file outside the package.json
Possible solution:

detox-config.json

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 8.0.0
  • Node: 8.9.4
@tomatobrown
Copy link

you can do this in the current build

const config = require('../config').detox;
await detox.init(config);

@oreporan
Copy link
Contributor Author

oreporan commented Aug 28, 2018

Unless I put a detox and configuration object in my package.json, I still get:

 if (_.size(config.configurations) === 1) {
                    ^
TypeError: Cannot read property 'configurations' of undefined
    at getDefaultConfiguration (/Users/ore/env/dev/repos/x/node_modules/detox/local-cli/detox-test.js:207:21)
    at Object.<anonymous> (/Users/ore/env/dev/repos/x/node_modules/detox/local-cli/detox-test.js:23:151)

@oreporan
Copy link
Contributor Author

This is due to

detox/local-cli.js
const config = require(path.join(process.cwd(), 'package.json')).detox;

@rotemmiz
Copy link
Member

You're right, we should give an opportunity for users to get an external config file, not only in package.json.
Logic may try getting config from package.json, and failover to a config file (or vice versa).

A PR is most welcome!

@noomorph
Copy link
Collaborator

noomorph commented Aug 29, 2018

@oreporan , check what's inside of your detox/tests/package.json. Maybe you modified something?

@oreporan
Copy link
Contributor Author

Sorry, I found the issue and removed the comment :)

@oreporan
Copy link
Contributor Author

Made a PR
#906

@LeoNatan
Copy link
Contributor

Closing in favor of #1238

@lock lock bot locked as resolved and limited conversation to collaborators Jun 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants