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 have found wish as well via "Refactoring JS". I have seen wish is having trouble under Windows, but while I am using that OS I haven't seen this specific error in other issues:
ReferenceError: repl is not defined
at getWishFromNodeHistory (node_modules/wish/lib/wish.js:118:5)
at getExpression (node_modules/wish/lib/wish.js:113:14)
at handleFalseWish (node_modules/wish/lib/wish.js:128:36)
at wish (node_modules/wish/lib/wish.js:145:15)
at Object.<anonymous> (src/App.test.js:15:7)
at Object.exec (node_modules/webdriverio/build/lib/helpers/safeExecute.js:28:24)
at Object.resolve (node_modules/webdriverio/build/lib/webdriverio.js:191:29)
at node_modules/webdriverio/build/lib/webdriverio.js:540:32
at _fulfilled (node_modules/q/q.js:854:54)
at self.promiseDispatch.done (node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (node_modules/q/q.js:816:13)
at node_modules/q/q.js:624:44
at runSingle (node_modules/q/q.js:137:13)
at flush (node_modules/q/q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:150:11)
I am trying to use wish together with Spectron and Jest to test an electron app.
From what I can see, "repl" is not defined in an electron context, but it can be require'd by adding:
const repl = require('repl');
However, that leads to another error:
TypeError: Cannot read property 'match' of undefined
at getWishFromNodeHistory (node_modules/wish/lib/wish.js:119:33)
at getExpression (node_modules/wish/lib/wish.js:114:14)
at handleFalseWish (node_modules/wish/lib/wish.js:129:36)
at wish (node_modules/wish/lib/wish.js:146:15)
at Object.<anonymous> (src/App.test.js:17:7)
at Object.exec (node_modules/webdriverio/build/lib/helpers/safeExecute.js:28:24)
at Object.resolve (node_modules/webdriverio/build/lib/webdriverio.js:191:29)
at node_modules/webdriverio/build/lib/webdriverio.js:540:32
at _fulfilled (node_modules/q/q.js:854:54)
at self.promiseDispatch.done (node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (node_modules/q/q.js:816:13)
at node_modules/q/q.js:624:44
at runSingle (node_modules/q/q.js:137:13)
at flush (node_modules/q/q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:150:11)
The text was updated successfully, but these errors were encountered:
So I'm not sure what the exact failure is here because I don't know what electron does for a stack trace. repl.repl.history[0] appears to be undefined.
If you are able to link to a project with setup instructions, so that I can reproduce, I can give it a try. Mainly, I'm curious if this would be the case for any electron app (meaning I could reproduce from basic instructions).
Alternatively, if you're interested in debugging this yourself, could you console.info repl.repl and repl.repl.history in the line above line 119?
That said, it's possible it will just be blank though. If the repl isn't actually in use as in a normal node runtime, then the __LINE__ analog will need to come from somewhere else (for browsers it looks at the loaded file whereas in a node shell, it looks at the repl history).
Maybe a better option would be to edit this function:
Remove the else clause from that all together, and see if it works. If it does, then the environment function should find a way to distinguish between browsers, electron, and node.
Again, thanks for reporting. I'll leave this open, but probably won't make this change myself in the short term at least. If you have any other ideas or want to make a patch, let me know.
Hi,
I have found wish as well via "Refactoring JS". I have seen wish is having trouble under Windows, but while I am using that OS I haven't seen this specific error in other issues:
ReferenceError: repl is not defined
I am trying to use wish together with Spectron and Jest to test an electron app.
From what I can see, "repl" is not defined in an electron context, but it can be require'd by adding:
const repl = require('repl');
However, that leads to another error:
The text was updated successfully, but these errors were encountered: