expo / eas-tests-example

Demo of running E2E tests on EAS Build
33 stars 2 forks source link

`e2e/tests/utils/openApp.js` too specific #10

Open vsquared10 opened 1 year ago

vsquared10 commented 1 year ago

The openApp.js utility file is a great work around for local development; however, when bootstrapping / setting up Detox, the detoxrc.js file can refer to a config format such as ios.sim.debug or some other intermediate nomenclature between & .

As such, the conditional designed to check for a debug environment, only passes if it is the 2nd element of a "." split array.

I propose checking to see if the configuration name contains the word "debug" instead.

module.exports.openApp = async function openApp() {
  const config = await resolveConfig();
  if (config.configurationName.split(".").includes("debug")) {
    return await openAppForDebugBuild(platform);
  } else {
    return await device.launchApp({
      newInstance: true,
    });
  }
};