detox test never ends. Don't have this issue in example.
just created react native project https://github.com/skv-headless/TestDetox
2017-10-25 11:34:01.569 TestDetox[71325:928047] 鈽o笍 DETOX:: Detox Action Received: invoke
2017-10-25 11:34:01.931 TestDetox[71325:928047] 鈽o笍 DETOX:: Detox Action Sent: invokeResult
2017-10-25 11:34:01.942 TestDetox[71325:928047] 鈽o笍 DETOX:: Detox Action Received: reactNativeReload
2017-10-25 11:34:01.945 TestDetox[71325:928047] 鈽o笍 Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.AccessibilityManagerQueue>
2017-10-25 11:34:01.945 TestDetox[71325:928047] 鈽o笍 Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.PlatformConstantsQueue>
2017-10-25 11:34:02.037 TestDetox[71325:928047] 鈽o笍 DETOX:: Detox Action Sent: ready
2017-10-25 11:34:02.050 TestDetox[71325:928047] 鈽o笍 DETOX:: Detox Action Received: invoke
2017-10-25 11:34:02.151 TestDetox[71325:928047] 鈽o笍 DETOX:: Detox Action Sent: invokeResult
2017-10-25 11:34:02.159 TestDetox[71325:928047] 鈽o笍 DETOX:: Detox Action Received: cleanup
2017-10-25 11:34:02.159 TestDetox[71325:928047] 鈽o笍 DETOX:: Detox Action Sent: cleanupDone

And it holds in this state forever.
I would love to provide more details or fix it myself. But it is hard due to compiled code (maybe you have some tip how to debug it)
I saw this behaviour with Mocha 4.0.0, which I saw that it is indeed what you use.
Until we figure out what broke , use mocha 3.5.x.
I will take the liberty to change the issue name to reflect the issue with mocha 4
Do you have --exit in the mocha.opts? it helped for me
@rotemmiz works like a charm. Thank you. Shall I leave this issue open in order to fix mocha 4.x compatibility?
Mocha now behaves (in this case) just like Jest, so this issue is also affecting Jest. This probably indicates a bug in Detox code. For now, we need to run Jest with forceExit: true.
Proposed fix is pushed to master, will be out next version.
Most helpful comment
Do you have
--exitin the mocha.opts? it helped for me