Edit: Below is the former question originally posted with the title
xunit show ITestOutputHelper output when run in the console
After investigation (see comments), the question is still very much relevant and in need of an answer but it seems that it should be addressed to the vstest
framework and around output sinks rather than xunit.
The specific question now is: When something is written to the dotnet vstest
output sink, how do I get it to display when running dotnet test
from the command line. Specifically I want to be able to set up a watcher with dotnet watch
to run tests continuously and I care more about output than results (I am using this less as a testing system and more as a development notebook). And I don't want to be limited to visual studio or vscode.
Original Question:
In my test class I have
[Fact]
public void Test() {
output.WriteLine("WHATEVER");
}
readonly ITestOutputHelper output;
public GroceryTests(ITestOutputHelper output) => this.output = output;
When I run this through the vscode in-editor integration I can see the output in the Output pane. When I run it via dotnet test
I do not. How do I get this output to show up via console?