How to remove approval debug information from assembly logs

When I run the approval tests, some debugging data from the certification test goes into my logs. It looks like 2/15/2016 1:58:48 PM ~000002ms Variable: approvalFrame = '' 2/15/2016 1:58:48 PM ~000025ms Variable: approvalFrame = '' 2/15/2016 1:58:48 PM ~000003ms Variable: approvalFrame = '' 2/15/2016 1:58:48 PM ~000002ms Variable: approvalFrame = '......

Is there any way to hide it from magazines?

Thanks.

+5
source share
1 answer

ApprovalTests uses SimpleLogger for logging. If you set it to null, it will not be logged in your files. If you want to use SimpleLogger afterwards, reset it.

  ApprovalUtilities.SimpleLogger.Logger.Writer = NullWriter.Instance; 

To reset

 Logger.Writer = new MultiWriter(new ConsoleWriter(),new DebugerWriter()); 

Of course, there are many other authors, and you can create your own composites or your own versions.

Happy testing!

+6
source

Source: https://habr.com/ru/post/1243053/


All Articles