How to publish results using dotnet test command

前端 未结 3 1771
后悔当初
后悔当初 2021-02-01 16:14

I have a test project written in dotnet core. This need to publish the results in an XML or HTML format. Is there a way I can publish the results to a particular directory using

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-01 17:03

    After stumbling on the same problem (I wanted to publish test results in JUnit format), I ended up finding the JUnitTestLogger NuGet package.

    It was a matter of installing it:

    dotnet add package JUnitTestLogger --version 1.1.0
    

    And then running the tests as:

    dotnet test --logger "junit;LogFilePath=path/to/your/test/results.xml"
    

提交回复
热议问题