Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stdout is not a tty. Using bash for node + tape + tap-spec

Was looking at a tape + tap video and tried to get it to work.
OS: Windows 7 Git Bash Shell

node main.js | ./node_modules/.bin/tap-spec

stdout is not a tty.

main.js:

var test = require('tape');
var add = require('./add');

test('add: two numbers add correctly', function(t) {
var actual = add(1,2);
var expected = 3;
t.equal(actual, expected);
t.end();
});

add.js:

module.exports = function(a, b) {
return a + b;
};

winpty node main.js | ./node_modules/.bin/tap-spec doesn't fix the problem.

like image 334
FreddyNoNose Avatar asked Aug 25 '17 22:08

FreddyNoNose


1 Answers

Just to add my case, I was facing similar issue. Neither solution of using winpty did help, thus I used different hint on using node.exe instead of node when running a script (from Git bash in my case).

not working:

node myscript.js < some-input.txt > some-output.txt

working:

node.exe myscript.js < some-input.txt > some-output.txt
like image 184
Thomas Urban Avatar answered Sep 27 '22 16:09

Thomas Urban