-
Notifications
You must be signed in to change notification settings - Fork 53
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 using 'node --inspect' to debug tests #108
Comments
Could we fully automate ports selection so that there is no need for defining ports? |
Yes, it's exactly the second case in the usage section, where no ports configuration is provided and they are chosen automatically. Once process is running in debug mode NodeJS prints debug port, so auto generated port will be sufficient to connect to the process using debugger. Port configuration option is mostly enhancement that will allow to have some fixed debugging configuration in IDE (I'm using "Node.js remote debug" option in WebStorm) that should not be updated each time. I'm currently working on PR, but I'm pretty sure that your implementation will be definitely better. Regarding implementation I think it should be something like the code below (in testrunner.js before forking the process)
Inspired by this post on StackOverflow. P.S. |
When cli.js executed by Node.js running in debug mode, child processes are also running in debug mode with different port. It is possible to run cli.js in normal mode and debug only child processes using --debug option. It is possible to specify debug port after --debug option. Close qunitjs#108.
After looking on code more deep I realised that @kof I've submitted PR few minutes ago, please take a look. I'm sure you know how to do it better, but idea remains the same. At least for me it solved the problem with test debugging. |
Hi, guys. Just curious, if you are going to complete this enhancement and provide an ability to debug execution of tests by node-qunit? |
I believe you can use Node.js CLI options such as
That will not cover sub processes, but at least it solves the issue of being able to use the Also consider using the official QUnit CLI, which might suite your needs: https://qunitjs.com/cli/ |
It would be beneficial to have Node.js debugging capabilities for tests.
Note:
Currently, when starting
node-qunit
CLI in debug mode using--debug-brk
child processes created by testrunner are created with the same debugging port, which causes an error.Requirements:
node-qunit
should have a configurable parameter that will trigger child processes to run in debug mode on port provided by this parameter.node-qunit
itself is running in debug mode and no port is provided by parameter,node-qunit
should be able to find free port and use it for debugging of child process.node-qunit
spawns new process for each test file, debugging port should be configurable for each test file.Usage:
--debug
parameter and list of ports in the same order as test filesnode-qunit
in debug mode using--debug-brk
The text was updated successfully, but these errors were encountered: