mozilla / fxa-auth-server

DEPRECATED - Migrated to https://github.com/mozilla/fxa
Mozilla Public License 2.0
399 stars 121 forks source link

Enable testing of server logging #1216

Closed philbooth closed 8 years ago

philbooth commented 8 years ago

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:

  1. As suggested in https://github.com/mozilla/fxa-auth-server/pull/1213#issuecomment-196631196, modify the test server to expose the log lines, then assert against them in the remote tests.
  2. 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.

philbooth commented 8 years ago

This issue got addressed some time ago by test/local/account_routes et al. Closing.