Detox: mocha: Detox interfers with .mocharc's "spec" property when Detox "specs" is not defined

Is your feature request related to a problem? Please describe.

It’s a bug(gy feature) of Detox.

If I specify the spec or files option in .mocharc.json

{
  "spec": "e2e/2_commandList.js",
  "timeout": 25000
}

and I don’t configure specs in the Detox config, relying on defaults:

Actual result:

The spec option clearly doesn’t work, because Detox overrides it with the default e2e value.

Describe the solution you’d like

Detox should not override ...specs with the default e2e value.

Describe alternatives you’ve considered

If I use the detox specs option in .detoxrc.json like this it works

But suppose if you have 10-20 test files, this wont be ideal to specify it in a string

  "specs": "e2e/init.js e2e/2_commandList.js",

File tree:

e2e
├── 1_runCommand.js
├── 2_commandList.js
├── init.js
└── utils.js

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 26

Most upvoted comments

I am sorry if I didn’t clear things up but I tried again and it seems to be working fine thanks. Maybe I messed up the spec with ‘s’

I would love to if you can point me to where to look for this (files or codes in the detox)

Thanks for the support guys!!!

@ShivamJoker yes, that’s exactly what I did for the first time. 😊