Without this change the test would throw the following exception:
Cannot use 'in' operator to search for 'b' in undefined
at Object.internals.reachCopy (/Users/watson/code/node_modules/@hapi/hoek/lib/applyToDefaults.js:76:23)
at Object.internals.applyToDefaultsWithShallow (/Users/watson/code/node_modules/@hapi/hoek/lib/applyToDefaults.js:66:19)
at Object.module.exports [as applyToDefaults] (/Users/watson/code/node_modules/@hapi/hoek/lib/applyToDefaults.js:23:26)
at /Users/watson/code/node_modules/@hapi/hoek/test/index.js:654:29
at Immediate.<anonymous> (/Users/watson/code/node_modules/@hapi/hoek/node_modules/@hapi/lab/lib/runner.js:661:35)
at processImmediate (internal/timers.js:461:21)
I discovered this issue when registering a route in hapi like so:
Without this change the test would throw the following exception:
I discovered this issue when registering a route in hapi like so:
The fact that
validate
isundefined
will make this call toroute
throw.