0

I'm looking for some pre-defined flag (macro) so I can skip a specific code in my App when I run detox.

if (__RUNNING_ON_DETOX__) {
  return; // skip this function
}

As a workaround, I'm using react-native-config and put ENVFILE on detox build. But I'm looking for a simpler way. If there is no flag that is provided from detox, I like to know the way that I could inject an inline export at least.

Thanks.

Bright Lee
  • 2,306
  • 2
  • 27
  • 55

1 Answers1

1

No predefined flag, but you can mock out the dependency that you don't want to interact with instead - see https://github.com/wix/Detox/blob/master/docs/Guide.Mocking.md

Marek Lisik
  • 2,003
  • 1
  • 8
  • 17