groupon / assertive

Assertive is a terse yet expressive assertion library
BSD 3-Clause "New" or "Revised" License
21 stars 11 forks source link

TTY check is broken #36

Closed jkrems closed 7 years ago

jkrems commented 7 years ago

assertive currently checks for process.isTTY. This is always undefined. The correct check would be process.stdout.isTTY:

> node -p process.isTTY
undefined

> node -p process.isTTY | cat
undefined

> node -p process.stdout.isTTY
true

> node -p process.stdout.isTTY | cat
undefined

The current behavior means that assertive always uses colors, breaking redirection to file.

jkrems commented 7 years ago

Closed via https://github.com/groupon/assertive/pull/37