hapijs / lab

Node test utility
Other
739 stars 176 forks source link

Allow to specify debugger interface #1049

Open danbraik opened 2 years ago

danbraik commented 2 years ago

Support plan

Context

What problem are you trying to solve?

I wanted to run the lab runner inside a docker and to attach to it a debugger. The problem is by default, node listen to 127.0.0.1 and we require to be 0.0.0.0 to go through network of docker-compose. Hapi/lab is just a little too restrictive to pass the argument to node.

Do you have a new or modified API suggestion to solve the problem?

Solution is to allow to pass [HOST]:[PORT] to node ( e.g. --inspect=0.0.0.0:9229 ) in file bin/lab, replace line 5 by:

const inspectPattern = /^(--inspect|--inspect-brk)(=.+)?$/;
Nargonath commented 2 years ago

It seems to me like a good feature. I don't foresee any particular complication with it but let's see what others think. Perhaps I've missed something.