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
So i clone the repo, and edit the example echo.js like this:
nexpect.spawn("echo",["xxx"])// echo something wrong.expect("hello")// this should fail.run(function(err){console.log(arguments);// hereif(!err){console.log("hello was echoed");}});
However i still got hello was echoed. The output is:
{ '0': [Error: xxx was not expected..] }
{ '0': null, '1': [ 'xxx' ], '2': 0 }
hello was echoed
This is wrong, right?
The text was updated successfully, but these errors were encountered:
I noticed the same. I'm not sure what intention with the run callback is.
Some of its args are things known only after child has exited, but it also is called immediately when an expectation fails. Possible correct behaviours are to, after an expectation has failed, not call it again (but in that case you don't really know when the child process is exited, which can be important to wait for before running another child). Another possibility is to when an expectation fails, save the err, terminate the child, and then call run once, but with the saved error.
So i clone the repo, and edit the example echo.js like this:
However i still got
hello was echoed
. The output is:This is wrong, right?
The text was updated successfully, but these errors were encountered: