ReferenceError: element is not defined .Facing this issue while I am trying to run test for ios in react native with jest as test runner

ReferenceError: element is not defined .Facing this issue while I am trying to run test for ios in react native with jest as test runner

应该有欢迎标题

ReferenceError: element is not defined

5 | }); 6 | 7 | it('should have welcome heading', async () => { | ^ 8 | await expect(element(by.id('InitialScreen'))).toBeVisible(); 9 | }); 10 | });

at _callee2$ (firstTest.spec.js:7:263) at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40) at Generator.invoke [as _invoke] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:271:22) at Generator.prototype.(anonymous function) [as next] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:97:21) at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40) at invoke (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:135:20) at ../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:170:11 at callInvokeWithMethodAndArg (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:169:16) at AsyncIterator.enqueue (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:192:13)

detox[64341] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config=e2e/config.json --maxWorkers=1 '--te stNamePattern=^((?!:android:).)*$' "./e2e/"

降级到较低版本的排毒解决了我的问题。