webdriverio-boneyard / wdio-mocha-framework

A WebdriverIO v4 plugin. Adapter for Mocha testing framework.
MIT License
39 stars 30 forks source link

ERROR: Cannot find module 'react-native' #152

Closed LayMuiToh closed 5 years ago

LayMuiToh commented 5 years ago

In my test.spec.js file, I want to call the play method from the react-native-sound module from the playAudio function

import Sound from 'react-native-sound'; function playAudio() { _player = new Sound('my.wav', Sound.DOCUMENT, (error) => { .....

_player.play((success) => {

..... if (_player && _player.release) { _player.release(); } }); }); }

module.exports = () => { describe('Voice input test at Main Page', function() { it('should able to speak show me basf and go to Main Page', function () { if(Main.mic.waitForExist()) { browser .touchAction('~f', 'longPress') .call(playAudio) .touchAction('~f', 'release');

however, when I run my test, I got the ERROR: Cannot find module 'react-native'

how do I setup mocha to enable me to call method from react-native-module.

christian-bromann commented 5 years ago

@LayMuiToh please don't repost this issue. I already told you that it has nothing to do with WebdriverIO.