detect terminal output with 'test -t' in tests