Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Detox test command failed #855

Closed
vaibhavdixit107 opened this issue Jul 24, 2018 · 8 comments
Closed

Detox test command failed #855

vaibhavdixit107 opened this issue Jul 24, 2018 · 8 comments

Comments

@vaibhavdixit107
Copy link

For usage help, ask a question on Stack Overflow with the detox tag. The issues section of the project is meant for opening bug reports and enhancement requests of Detox. We use it to automatically track the change log

IMPORTANT: Use search before opening an issue. Duplicate issues will simply be closed.

Description

Hi,
We are making an app in react-native. For the E2E testing we are using Detox, the test runner is Jest. I installed detox-cli and detox both globally and locally as dev dependencies. When I try to run detox build, it makes a successful build for the android, all other commands with the detox keyword works well for me. But when I try to run detox test it fails. It throws me this error.

Error: Command failed: node_modules.bin\jest e2e --config=e2e/config.json --maxWorkers=1 --testNamePattern='^((?!:ios:).)*$'

at checkExecSyncError (child_process.js:601:13)
at Object.execSync (child_process.js:641:13)
at runJest (C:\Users\vdixit\AppData\Roaming\npm\node_modules\detox\local-cli\detox-test.js:146:6)
at run (C:\Users\vdixit\AppData\Roaming\npm\node_modules\detox\local-cli\detox-test.js:81:7)
at Object.<anonymous> (C:\Users\vdixit\AppData\Roaming\npm\node_modules\detox\local-cli\detox-test.js:191:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

I spent a quite lot of time to figure this error, but didn't get through. I was using version 8.0.0 for detox and then I switched to version 7.4.0. but I get the same error.

This is how my package.json looks like:

{

"name": "test",
"version": "1.0.0",
"private": true,
"devDependencies": {
"@babel/core": "^7.0.0-beta.54",
"babel-eslint": "^8.2.3",
"babel-preset-react-native": "^4.0.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"detox": "^7.4.0",
"detox-cli": "^7.4.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.4",
"eslint": "^5.0.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-config-airbnb-base": "^13.0.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jest": "^21.17.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.9.1",
"eslint-plugin-react-native": "^3.2.1",
"jest": "^23.4.1",
"jest-html-reporter": "^2.3.0",
"jest-react-native": "^18.0.0",
"mock-socket": "^7.1.0",
"prettier": "^1.13.4",
"prettier-eslint": "^8.8.1",
"react-addons-test-utils": "^15.6.2",
"react-test-renderer": "16.2.0",
"sinon": "^5.0.10"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"docs": "jsdoc -c .jsdoc.json",
"test": "jest"
},
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!react-native|react-navigation|native-base|@expo)/"
],
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
"collectCoverage": true,
"testResultsProcessor": "./node_modules/jest-html-reporter"
},
"dependencies": {
"babel-jest": "^23.2.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"native-base": "^2.4.2",
"prop-types": "^15.6.1",
"react": "16.2.0",
"react-dom": "^16.3.2",
"react-native": "0.52.0",
"react-native-vector-icons": "^4.6.0",
"react-native-zeroconf": "^0.9.0",
"react-navigation": "^2.6.0",
"react_native_mqtt": "^1.1.9"
},
"jest-html-reporter": {
"pageTitle": "Your test suite",
"outputPath": "test-report.html",
"includeFailureMsg": true,
"sort": "executionAsc",
"theme": "lightTheme",
"includeConsoleLog": true
},
"detox": {
"test-runner": "jest",
"runner-config": "e2e/config.json",
"configurations": {
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "pushd android && gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && popd",
"type": "android.emulator",
"name": "Nexus_5X_API_26"
}
}
}
}

Steps to Reproduce

Detox, Node, Device, Xcode and macOS Versions

  • Detox:7.4.0
  • React Native:0.52.0
  • Node:8.11.1
  • Device:Android Simulator "Nexus_5X_API_26"
  • Xcode:
  • macOS:

Device and verbose Detox logs

@noomorph
Copy link
Collaborator

noomorph commented Jul 25, 2018

Wait for 8.0.1 version for a couple of days. Or if you are impatient, try replacing your detox-test. js in node_modules/detox/local-cli folder with the one from master.

I think you have bumped into an already fixed issue, it just has not been released yet.

https://github.com/wix/detox/pull/763/files

@LeoNatan
Copy link
Contributor

I'm not sure the use of "more info needed" label here is correct. @noomorph What information are you looking from the user? If the issue has been solved in a pull request or in master, please close the issue.

@noomorph
Copy link
Collaborator

I want @aibhavdixit107 to check if the patch to local-cli/detox-test.js helps in his case.

If yes - I'm closing the issue.
If this is another issue - then I'll be asking for more info.

I need at least a yes or a no.

@LeoNatan
Copy link
Contributor

👍
But in the previous comment, your request was presented as "if you are impatient". Also know that "more info needed" sets a timer to automatically close the issue after 7 days. So if the user is patient and 8.0.1 does take longer than 7 days, the issue will close.

@noomorph
Copy link
Collaborator

I think we release today after the noon.

@noomorph
Copy link
Collaborator

Also know that "more info needed" sets a timer to automatically close the issue after 7 days.

Exactly, that's why I put the label on. :)

@vaibhavdixit107
Copy link
Author

Thanks it solved my issue.

@lock
Copy link

lock bot commented Jul 28, 2018

This thread has been automatically locked to prevent bumping of old threads. Instead, if you believe the issue still reproduces, please open a new issue and provide all the required information.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 28, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants