Replies: 2 comments
|
Hi @akovac35 Thank you. I think I understand what you are saying. You want a way get If that's the case, I actually have something in place already for xUnit, although it is not yet documented, as you have discovered. To use it, do the following: public class MyComponentTest : TestContext
{
public MyComponentTest(ITestOutputHelper output)
{
// Wraps ITestOutputHelper in a custom ILoggerFactory, which will then be used by components and blazors renderer.
Services.AddXunitLogger(output, minimumLogLevel: LogLevel.Debug);
}
//...
}You are very welcome to improve on the impementation of this, and if you want to provide a similar experience for MSTest/NUnit, please let me know so we we can discuss design details. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Thanks for creating this library.
I am planning to use it and, reviewing the documentation, I was not able to find much information about writing the component render to unit test output easily. For example:
https://github.com/akovac35/Logging#unit-test-logging
https://github.com/akovac35/Logging.Samples/blob/master/TestApp/TestLoggingExamples.cs
I think it would help quite a lot if a developer would be able to see the component render while developing the test, for quick test updates. It would make sense for the render object to contain a method which would write the render result to unit test output.
Is this something we can contribute? If so, please suggest the classes to update.
All reactions