Add informative error message for known point of failure (observers like Tap coverage on Node 8) #205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
0x fails in lib/ticks-to-tree.js if it is running inside a Tap test with coverage enabled on Node 8, which causes lib/random-require.js to return an empty string. There are probably other similar scenarios too, where something observing child processes interferes.
The point it fails doesn't give much of a clue about what happened - it's an assert in a file two removed from where the problem actually occurs, and the problem itself happens in random-require.js which is hard to debug because it uses console.log output to communicate with the parent process that calls it. Then quite a leap of logic is needed to link this to the actual cause (e.g. Tap coverage).
So it's helpful to give users and contributors an informative error message at this point.