Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Expo SDK36 + Detox - Hanging on reloadApp()

$
0
0

Detox is not working with Expo SDK 36?

Debugging reveals that it's hanging on await device.launchApp() in reloadApp() within detox-expo-helpers.

I've gone through the setup highlighted in: Is it actually possible to make Detox/Jest tests pass with a React Native app running with Expo?

Example of my test:

const { reloadApp } = require('detox-expo-helpers');

describe('Example', () => {
  beforeEach(async () => {
    await reloadApp();
  });

  it('should have welcome screen', async () => {
    await expect(element(by.id('welcome'))).toBeVisible();
  });
});

package.json

"scripts": {
        "e2e": "detox test --configuration ios.sim",
    },
    "devDependencies": {
        "babel-eslint": "^10.0.3",
        "babel-preset-expo": "^7.0.0",
        "detox": "^15.2.2",
        "detox-expo-helpers": "^0.6.0",
        "eslint-config-airbnb": "^18.0.1",
        "eslint-config-prettier": "^6.7.0",
        "eslint-plugin-prettier": "^3.1.1",
        "expo-detox-hook": "^1.0.10",
        "jest-expo": "^35.0.0",
        "pusher-js-mock": "^0.2.0",
        "react-native-testing-library": "^1.12.0",
        "react-test-renderer": "^16.12.0"
    },
    "private": true,
    "detox": {
        "configurations": {
            "ios.sim": {
                "binaryPath": "bin/Exponent.app",
                "type": "ios.simulator",
                "name": "iPhone 11"
            }
        },
        "test-runner": "jest"
    }

Even if I bypass the hanging promise via

    function timeout(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
    beforeEach(async () => {
        reloadApp();
        await timeout(12000);
    });

It hangs on await expect(element(by.id('welcome'))).toBeVisible();

What am I doing wrong?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>