0

I am doing Detox testing and matching takes default as ios and I want to test in android, I am not able to change it to android. help me

skyboyer
  • 22,209
  • 7
  • 57
  • 64
Krupanand K
  • 165
  • 2
  • 11

1 Answers1

0

Detox isn't running an iOS test. It only looks like that because of the negative lookahead in the regex.

```--testNamePattern='^((?!:ios:).)*$'`

It's a negative lookahead, which means that for the expression to match, the part within (?!...) must not match

update to comment

Currently there is an issue in react-native:0.57.8 that is causing the the following error:

Error: Couldn't find preset "module:metro-react-native-babel-preset"

There is currently a workaround that can be found here https://github.com/facebook/react-native/issues/21241#issuecomment-431464191

Step 1

Create babel.config.js with the following content (basically equivalent to stock .babelrc)

module.exports = function (api) {
  api.cache(true)

  return {
    presets: ['module:metro-react-native-babel-preset']
  }
}

Step 2

Remove .babelrc

Step 3

Run yarn add --dev babel-jest babel-core@^7.0.0-bridge.0 @babel/core

Personally I haven't needed to do step 3.

Andrew
  • 26,706
  • 9
  • 85
  • 101
  • Thank you, which means we no need to worry about this. I am getting this error how to resolve it "Couldn't find preset "module:metro-react-native-babel-preset" relative to directory". I have did https://stackoverflow.com/a/52347785/10031919 this still it showing this issue – Krupanand K Dec 26 '18 at 08:53
  • Thank you, I have this issue could you help to resolve issue. "Error: Error: No views in hierarchy found matching detox", While navigating from one screen to other screen I am getting this error, I am not able to find next screen elements because of this issue – Krupanand K Dec 27 '18 at 11:19
  • I would suggest asking a new question on stackoverflow. There you can post the error message in full and what you have tried to resolve it. – Andrew Dec 27 '18 at 11:24