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
If I change the response to be the stdout of an require('child_process').exec such as:
robot.respond /hi$/i, (msg) ->
@exec = require('child_process').exec
command = "echo hi"
@exec command, { shell: '/bin/bash' } , (error, stdout, stderr) ->
if error
msg.send "@#{msg.message.user.name} " + "Ops! Not able to run "+ command +" ```" + stderr + "```"
else
msg.reply stdout
Then the test fails with only two messages in the room with no responses from hubot. Yet if I run the hubot then the output of @exec command appears as expected.
How do I test code that uses @exec command to generate hubot responses?
The text was updated successfully, but these errors were encountered:
With a spec:
Then a synchronous reply works as expected:
If I change the response to be the stdout of an
require('child_process').exec
such as:Then the test fails with only two messages in the room with no responses from hubot. Yet if I run the hubot then the output of
@exec command
appears as expected.How do I test code that uses
@exec command
to generate hubot responses?The text was updated successfully, but these errors were encountered: