another one for the test runner:
Description
Using child_process for test parallisation also sets process.stdout.isTTY to undefined.
The following returns undefined when it's run with node --test:
# node --test example.test.js
console.log(process.stdout.isTTY)
# undefined
when it's run with plain node, it's true:
# node example.test.js
console.log(process.stdout.isTTY)
# true
I had a very faint memory of a similar issue described by someone else,
very similar to this and IIRC about the child_process.
So, I run the same with --experimental-test-isolation=none and there it is: it returns true which confirms my suspicions.
# node --test --experimental-test-isolation=none example.test.js
console.log(process.stdout.isTTY)
# true
Although you can work around it, it's very problematic for the following reasons:
- It's inconsistent with POLA
- It' inconsistent with it's own API because it reports one way with one flag, and another without.
- It leaks implementation details
How the tests are run is an implementation detail that shouldn't be leaking like that.
I'm sure there are some valid reasons for it but this feels plain wrong.
Thoughts?
Note: I only suspect these 2 issues are related.
another one for the test runner:
Description
Using
child_processfor test parallisation also setsprocess.stdout.isTTYtoundefined.The following returns
undefinedwhen it's run withnode --test:when it's run with plain node, it's
true:I had a very faint memory of a similar issue described by someone else,
very similar to this and IIRC about the
child_process.So, I run the same with
--experimental-test-isolation=noneand there it is: it returnstruewhich confirms my suspicions.Although you can work around it, it's very problematic for the following reasons:
How the tests are run is an implementation detail that shouldn't be leaking like that.
I'm sure there are some valid reasons for it but this feels plain wrong.
Thoughts?
Note: I only suspect these 2 issues are related.