Skip to content

dgram: extract cluster lazy loading method to make it testable

Rodrigo Muino Tomonari requested to merge github/fork/pd4d10/patch-9 into master

There is no need to ensure cluster loaded in bindServerHandle because it's already loaded before calling it.

This PR makes cluster as an argument to remind developers that cluster needs to be loaded before calling this function.

Update: The lazy load parts in bindServerHandle is unreachable because cluster has been loaded before calling it. Extract it to a seperated method to make the code testable.

Refs: https://coverage.nodejs.org/coverage-26e318a321a872bc/lib/dgram.js.html#L202

Merge request reports

Loading