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

Detox test overwrites mocha grep option with --grep :android: --invert #712

Closed
Ljo2017 opened this issue May 3, 2018 · 7 comments
Closed

Comments

@Ljo2017
Copy link

Ljo2017 commented May 3, 2018

It seems that when running detox test, the grep options in mocha.opts gets overwritten by detox test and therefore not recognised.

Detox command used:
detox test -c ios.sim.release

Log:
node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.sim.release --grep :android: --invert

detox info 15:09:15: server listening on localhost:60573...
detox info 1: Searching for device matching iPhone 7...

It looks as if --grep :android: --invert overwrites the grep option in mocha.opts.

If I run the command below, the grep option in mocha.opts is recognised:
node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.sim.release

Can we have this automatic platform deduction logic removed? Or is there any way not to have the mocha.opts option overwritten?

  • Detox: 7.3.4
  • React Native: .55
  • Node: 8.9.4
  • Device: iOS simulator
  • Xcode: 9.2
@rotemmiz
Copy link
Member

rotemmiz commented May 3, 2018

For mocha you don't need to use Detox command line tool.
You can actually just use mocha's command line directly:
mocha e2e --opts e2e/mocha.opts --configuration ios.sim.release

Every detox cli param is passed almost with no change.

@noomorph
Copy link
Collaborator

noomorph commented May 4, 2018

@Ljo2017 if you provide a function covered with integration tests that is able to merge :platform: grep expression with an arbitrary user input for mocha --grep, I think we could actually use it for detox+mocha in next releases. But Rotem is right, and his way should work for you too, in a short and, most likely, in a long run too.

@Ljo2017
Copy link
Author

Ljo2017 commented May 22, 2018

@noomorph we've made changes to merge the platform grep expression with the existing grep options in mocha.opts file and tried to make a pull request but got a permission denied error.

ERROR: Permission to wix/detox.git denied to Ljo2017.
fatal: Could not read from remote repository.

Could you give me access to the repository to make a pull request?

@noomorph
Copy link
Collaborator

@Ljo2017 , please follow the regular GitHub workflow for pull requests.

  1. Fork detox to your account using Fork button on the right.
    screenshot from 2018-05-22 13-24-01
  2. Commit your change to master branch.
  3. And follow the GitHub instructions:
    https://help.github.com/articles/creating-a-pull-request-from-a-fork/

@Ljo2017
Copy link
Author

Ljo2017 commented May 22, 2018

Thanks @noomorph.
Created a PR #748.

@stale
Copy link

stale bot commented Jul 6, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.

@stale stale bot added the 🏚 stale label Jul 6, 2018
@stale
Copy link

stale bot commented Jul 13, 2018

The issue has been closed for inactivity.

@stale stale bot closed this as completed Jul 13, 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