facebook-atom / jest-electron-runner

custom test runner for Jest that allows tests to be run in Electron environment
MIT License
189 stars 33 forks source link

Node Inspector Not Working #30

Closed daniel-nagy closed 4 years ago

daniel-nagy commented 5 years ago

I am unable to put a debugger statement in my tests as described in Troubleshooting. The test run without hitting the debugger.

daniel-nagy commented 5 years ago

I can't log to stdout using console.log either.

aaronabramov commented 5 years ago

debugger support is a little complicated, because the test are not run in one process, but rather across multiple processes, and i'm not sure how to point the debugger to the right process yet.

stdout is pretty much the same story. it gets printed in some other process and the output sometimes is not forwarded to the main process. i will look into fixing this soon, it's blocking some other features as well!

Circuit8 commented 5 years ago

Yes having a big issue with this myself, seems pretty much impossible to get an interactive debugger on breakpoints in electron with jest or mocha. jest-electron has been awesome for me, but would be a god send if this was included @aaronabramov

Or if you know any workaround or alternative at the moment I'd love to hear it. Cheers.

mongkuen commented 5 years ago

Also interested in any updates about debugging/logging. Really awesome otherwise so far!

aguynamedben commented 5 years ago

Is there another way people are debugging? When my tests fail it's really hard to tell why. Would something like this work?

I don't know of any other ways I can inspect variables in a failing test. Any ideas?

Circuit8 commented 5 years ago

@aguynamedben I'm still on using console.log. If you find any solution I'd love to hear.

hustcc commented 4 years ago

debug mode, have a try with jest-electron. https://github.com/facebook-atom/jest-electron-runner/issues/50

jonbiere commented 4 years ago

@aaronabramov is there a path forward on adding debugger support while using this test runner? Or is this just a side effect the multiple process implementation you mentioned? Is it possible to configure this to run on one process?

I am using vscode with the following in my launch.json and no breakpoints or console.log statements seem are hit. Is it possible maybe to add configuration to point to the the node debugger process? { "type": "node", "request": "launch", "name": "Jest Test", "program": "${workspaceFolder}\\node_modules\\jest\\bin\\jest", "args": ["--runInBand", "--config=${workspaceFolder}\\jest.config.js"], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", },