Write some local tests that mock the entire universe of Hapi and Joi etc, so that we can proxyquire-inject test stubs for the log methods and assert that they are called as expected.
Option 1 is both easier and far closer to being a real-world test. However, option 2 might have some benefit if we found that there were other test stubs we wanted to inject into the server code. I can't think of any at the moment, but calling it out here just in case.
Currently, we assert that log methods behave correctly in
test/local/log_tests.js
. But there is nowhere that we assert they are called correctly.I can think of two ways to go about it:
Option
1
is both easier and far closer to being a real-world test. However, option2
might have some benefit if we found that there were other test stubs we wanted to inject into the server code. I can't think of any at the moment, but calling it out here just in case.