You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to setup Detox in an Expo project. Both Jest and Mocha fail with 'cannot find module' error. Jest complains about not finding fs-extra, Mocha about source-map-support. Seems like the issue is with test runners not knowing where to search for Detox dependencies.
Steps to Reproduce
Follow Detox guide to install all dependencies
Generate e2e folder with detox init -r jest
Substitute device.reloadReactNative() with reloadApp() from detox-expo-helpers
Run detox test -c ios:sim
Detox, Node, Device, Xcode and macOS Versions
Detox: 10.0.7
React Native: 0.57.7
Expo: 31.0.5
Node: 9.11.2
Device: iOS Simulator
Xcode: 10.1 beta
macOS: 10.13.6
Device and verbose Detox logs
configuration="ios.sim" loglevel="verbose" artifactsLocation="artifacts/ios.sim.2019-02-16 06-51-34Z" node_modules/.bin/jest "e2e" --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:android:).)*$'
● Deprecation Warning:
Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths.
Please update your configuration.
Configuration Documentation:
https://jestjs.io/docs/configuration.html
FAIL ../../../mnt/Documents/Projects/ExpoApp/e2e/firstTest.spec.js
● Test suite failed to run
Cannot find module 'fs-extra' from 'logger.js'
However, Jest was able to find:
'utils/logger.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
However, Jest was able to find:
'./Detox.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
at Resolver.resolveModule (../../../../../../Users/dols3m/va/node_modules/jest/node_modules/jest-resolve/build/index.js:203:17)
at Object.<anonymous> (../node_modules/detox/src/utils/logger.js:2:12)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.945s
Ran all test suites matching /e2e/i with tests matching "^((?!:android:).)*$".
child_process.js:615
throw err;
^
Error: Command failed: node_modules/.bin/jest "e2e" --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:android:).)*$'
at checkExecSyncError (child_process.js:575:11)
at Object.execSync (child_process.js:612:13)
at runJest (/Users/dols3m/va/node_modules/detox/local-cli/detox-test.js:166:6)
at run (/Users/dols3m/va/node_modules/detox/local-cli/detox-test.js:86:7)
at Object.<anonymous> (/Users/dols3m/va/node_modules/detox/local-cli/detox-test.js:229:1)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
The text was updated successfully, but these errors were encountered:
Description
I am trying to setup Detox in an Expo project. Both Jest and Mocha fail with 'cannot find module' error. Jest complains about not finding
fs-extra
, Mocha aboutsource-map-support
. Seems like the issue is with test runners not knowing where to search for Detox dependencies.Steps to Reproduce
e2e
folder withdetox init -r jest
device.reloadReactNative()
withreloadApp()
from detox-expo-helpersdetox test -c ios:sim
Detox, Node, Device, Xcode and macOS Versions
Device and verbose Detox logs
The text was updated successfully, but these errors were encountered: