Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add support for --inspect and --inspect-brk options #5

Open
papinto opened this issue Feb 9, 2019 · 3 comments
Open

Add support for --inspect and --inspect-brk options #5

papinto opened this issue Feb 9, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@papinto
Copy link

papinto commented Feb 9, 2019

Mocha supports the --inspect and --inspect-brk options:
--inspect // activate devtools in chrome
--inspect-brk // activate devtools in chrome and break on the first line

It would be helpful if mochapack can pass these options through to mocha.

@larixer
Copy link
Member

larixer commented Feb 9, 2019

@papinto Yep, agreed. Good point!

@larixer larixer added the enhancement New feature or request label Feb 9, 2019
@jamesopti
Copy link

This is critical for our development flow, as it enables debugging any issues in the runtime.

Are there any plans to add this soon?

@larixer
Copy link
Member

larixer commented Mar 9, 2019

I guess you are looking to get good debugging experience with this tool, not just pass --inspect to node. The latter is easy, just launch it as node node_module/.bin/mochapack --inspect --inspect-brk ....

The former, i.e. getting good debugging experience is more tricky. The debugging support is there for quite a while and it is documented:
https://sysgears.github.io/mochapack/docs/guides/ide-integration.html

I have submitted example project that follows the docs to set up debugging, in this PR:
#10

It mostly works for me, but there is rather nasty issue, that on the first mochapack run my breakpoints do not get hit, on the second run they work fine. So in order to debug I have to start mochapack in watch mode, then allow it to run the tests, then I set breakpoint in the test of concern and modify this test slightly, this triggers second run of mochapack and my breakpoint hit this time (teseted in VS Code and in Google Chrome)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants