-
Couldn't load subscription status.
- Fork 7.3k
Avoid printing header if piped to a script #796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
70deeb6
797020a
67584de
95a0f2c
08c774c
fb97c00
87e2008
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -264,7 +264,7 @@ Requesting a code review from you | |
| } | ||
| } | ||
|
|
||
| func TestPRList(t *testing.T) { | ||
| func TestPRList_stdout_is_not_a_tty(t *testing.T) { | ||
| initBlankContext("", "OWNER/REPO", "master") | ||
| http := initFakeHTTP() | ||
| http.StubRepoResponse("OWNER", "REPO") | ||
|
|
@@ -278,17 +278,14 @@ func TestPRList(t *testing.T) { | |
| t.Fatal(err) | ||
| } | ||
|
|
||
| eq(t, output.Stderr(), ` | ||
| Showing 3 of 3 pull requests in OWNER/REPO | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would recommend that we hold off merging this until we figure out how to simulate tty mode for tests so we can keep asserting this output. The header is an important part of output and I wish we can keep test coverage of it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that is fair. In reviewing #572 and then returning to this I think we need to step back and design a holistic approach to determining what kind of output (both formatting and color) to use; something routed via the
This comment was marked as spam.
Sorry, something went wrong. |
||
|
|
||
| `) | ||
| eq(t, output.Stderr(), ``) | ||
| eq(t, output.String(), `32 New feature feature | ||
| 29 Fixed bad bug hubot:bug-fix | ||
| 28 Improve documentation docs | ||
| `) | ||
| } | ||
|
|
||
| func TestPRList_filtering(t *testing.T) { | ||
| func TestPRList_filtering_stdout_is_not_a_tty(t *testing.T) { | ||
| initBlankContext("", "OWNER/REPO", "master") | ||
| http := initFakeHTTP() | ||
| http.StubRepoResponse("OWNER", "REPO") | ||
|
|
@@ -302,10 +299,7 @@ func TestPRList_filtering(t *testing.T) { | |
| } | ||
|
|
||
| eq(t, output.String(), "") | ||
| eq(t, output.Stderr(), ` | ||
| No pull requests match your search in OWNER/REPO | ||
|
|
||
| `) | ||
| eq(t, output.Stderr(), ``) | ||
|
|
||
| bodyBytes, _ := ioutil.ReadAll(http.Requests[1].Body) | ||
| reqBody := struct { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated test name makes me think that we should really have a way to force "tty mode" in tests to be able to assert such output. 🤔
This is not something that you have to do in this PR, btw. I don't know yet how would we pass that information to tests.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.