expo / detox-expo-helpers

44 stars 34 forks source link

require detox device to solve ReferenceError #12

Closed yaron1m closed 5 years ago

yaron1m commented 5 years ago

I was trying to run detox sample test on my app, which is using:

And I always get the following error:

    ReferenceError: device is not defined

      at Object.reloadApp (../node_modules/detox-expo-helpers/index.js:68:3)

When I added the following require: const { device } = require('detox'); The issue was solved.

In order to do so, I had to add detox as a dependency.

chakrihacker commented 5 years ago

Please merge this

chakrihacker commented 5 years ago

Hi, I tried adding device import, but I am encountering launchApp is null issue when I added it.

yaron1m commented 5 years ago

Did it work when detox was a dependency?

chakrihacker commented 5 years ago

nope

nicoboy11 commented 5 years ago

Why this hasn`t been merged?

yaron1m commented 5 years ago

I managed to get it all working without this change. This can be closed https://github.com/yaron1m/expo-detox-typescript-example