-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose the robot logger #37
Comments
I had this issue, but found it was a problem with how I was accessing or triggering the robot and listener (which creates the response object, which includes the robot, which includes the logger). Here's a basic working example (coffeescript). Obviously the npm modules used need to be installed. Hope it helps. |
You can access the robot via |
@alFReD-NSH that's a great idea. However, it seems it's not working (although it could be a bug in my test code) because the logging happens immediately on module initialization. See strugee/hubot-bridge#6. |
@strugee I've created hubot-pretend, which was initially a fork of hubot-test-helper but I've added lots of features now, such as easy access to an internal array keeping all the logs produced by robot logger for test assertions. Here's an example test interrogating the logs... https://github.com/PropertyUX/hubot-pretend/tree/master/test/usage |
My module logs an error message if an environment variable isn't set. However, there's no way to test for that because I can't get access to the robot logger (or it isn't documented). It would be nice if hubot-test-helper would intercept calls to
robot.logger.*
and allow me to call assertions on logs.The text was updated successfully, but these errors were encountered: