You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has anyone written unit tests for scripts that include/call hubot-auth? I haven't found any solid examples of how to stub out the 'hasRole' or 'isAdmin' functions. I've played around with my own using sinonjs, but when I finally get it passing, the script actually doesn't work in chat, and a working script doesn't pass the unit tests. It also requires modification to auth.coffee in order to get it to pass the test.
I'm guessing I'm probably doing it wrong. Has anyone stubbed this out before?
The text was updated successfully, but these errors were encountered:
@GSAgentP I dont think unit tests are possible when implementing hubot listener function, i recommend you pull out everything you can using methods, which you can test.
Has anyone written unit tests for scripts that include/call hubot-auth? I haven't found any solid examples of how to stub out the 'hasRole' or 'isAdmin' functions. I've played around with my own using sinonjs, but when I finally get it passing, the script actually doesn't work in chat, and a working script doesn't pass the unit tests. It also requires modification to auth.coffee in order to get it to pass the test.
I'm guessing I'm probably doing it wrong. Has anyone stubbed this out before?
The text was updated successfully, but these errors were encountered: