我正在尝试运行Detox测试,并发现这个错误"Cannot find module 'detox/runners/jest/adapter' from 'init.js'"。
node_ e2e /..bin/jest e2e --config=e2e/config.json --maxWorker=1-testNamePattern=‘^((?:ios:))*$’Faile2e/FirstTest.spec.js测试套件失败运行 无法在(../node_modules/jest-resolve/build/index.js:191:17) at Object的“init.js”中找到模块‘detox/ find /jest/适配器’。(init.js:3:13) 测试套件:1次失败,1次总测试:0次总快照:0次总时间: 1.27s运行所有匹配/e2e/i与测试匹配的测试套件“^((?:ios:).)*$”。child_process.js:643抛错;^ 错误:命令失败:node_ e2e /..bin/jest e2e --config=e2e/config.json --maxWorker=1-testNamePattern=‘^((?::ios:).)*$’at checkExecSyncError (child_process.js:603:11) at Object.execSync (child_process.js:640:13) at runJest在对象上运行(/Users/neeraj.kumar/Neeraj/Projects/sampleApp/node_modules/detox/local-cli/detox-test.js:78:7)。(/Users/neeraj.kumar/Neeraj/Projects/sampleApp/node_modules/detox/local-cli/detox-test.js:180:1) at Module._compile (内部/模块/cjs/loader.js:689:30),Object.Module._extensions..js (内部/模块/cjs/loader.js:700:10),Module.load (内部/模块/cjs/loader.js:599:32),tryModuleLoad (内部/模块/cjs/加载器)。( .js:538:12) at Function.Module._load (内部/模块/cjs/loader.js:530:3)
命令:detox test -c android.emu.debug
package.json:
{
"name": "sampleApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test-android": "detox build --configuration android.emu.debug && detox test --configuration android.emu.debug -l verbose"
},
"dependencies": {
"npm": "^6.1.0",
"react": "16.2.0",
"react-native": "0.53.3"
},
"devDependencies": {
"babel-jest": "21.2.0",
"babel-plugin-transform-react-jsx-source": "^6.22.0",
"detox": "7.4.0",
"jest": "21.2.1",
"react-test-renderer": "16.0.0-beta.5"
},
"detox": {
"test-runner": "jest",
"specs": "e2e",
"runner-config": "e2e/config.json",
"configurations": {
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.emulator",
"name": "Nexus_5X_API_28_x86"
}
}
}
}有什么问题吗?当我看到我的node_module >>解毒文件夹时,我看不到runner文件夹。我错过了什么吗?
发布于 2018-07-13 07:54:28
将detox依赖项更新为^8.0.0。
https://stackoverflow.com/questions/51318399
复制相似问题