Open piranna opened 7 years ago
Great idea!
node-suppose
now works using node-pty
, but it's fairly unstable on the
output checking, probably due to hiddend ANSI characters or invisible ones,
specially end of lines. Usage of regular expressions and clean-up of outputs
solve it up to some point, but probably would be better to use Buffer objects
instead of strings and use a monitor tool to store exactly the full output for
inspection.
Ok, this need some improvement specially for testing, but it works :-) I have been able to trick Docker to use -t
flag and test NodeOS on Docker without needed special cases :-D
Hello, i try use docker exec -it
command but it doesn't work. I have the input device is not a TTY
error message.
suppose('docker', ['exec', '-it', 'container_name', 'command'], { debug: fs.createWriteStream('/tmp/debug.txt') })
.when('test').respond('yes\n')
.on('error', function(err) {
console.log(err.message);
})
.end(function(code) {
console.log(code);
})
Thanks for your help.
What version are you using? TTY is only currently available in master, not in npm
.
Ok, my bad. Thanks for your quick response.
@piranna great news 😄 when do you plan on publishing it to npm ?
@piranna great news when do you plan on publishing it to npm ?
Problem is that although it's working tests are unstable, so I would like to have them before publishing a new version. I have been very busy in the last months, if you would be able to take a look at them and do a pull-request maybe we can move it forward :-)
Seems Docker needs that terminal to be a TTY to allow to enable both the
-i
and-t
flags, butnode-suppose
is using regular streams. Probably it would be needed to usepty.js
to enable them.