Shallow rendering #546
Replies: 2 comments 7 replies
-
Hi Danny, It was part of 1.2.x-preview but was rolled back due to some corner cases that required the solution to be something different. However, there is something very similar, that might offer the functionality you need. Its not yet documented, but I did discuss it with Hassan and Brian on their show yesterday. If you jump to around 1:25 in the video, you will get a quick intro to it: https://www.youtube.com/watch?v=2xvnF8Qu8MQ |
Beta Was this translation helpful? Give feedback.
-
Just realized, that you can of course get very close to shallow rendering by doing this: ComponentFactories.AddStub(x => x != typeof(ComponentUnderTest));
var cut = RenderComponent<ComponentUnderTest>(); This will stub out all components except for the You could even put it into an extension method on TestContextBase and call it public static IRenderedComponent<T> ShallowRender<T>(this TestContextBase ctx)
{
ctx.ComponentFactories.AddStub(x => x != typeof(T));
return ctx.RenderComponent<T>();
} |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm looking for the current status on Shallow rendering.
According to https://bunit.dev/docs/test-doubles/shallow-rendering.html it's still in progress and not out yet.
I can also see that half a year ago a question was asked to test it out:
#401
In this topic it sounds like Shallow rendering was part op the 1.2 release.
I'm using 1.2.49 version now. If it's now out yet, is there any ETA?
Thanks,
Danny
Beta Was this translation helpful? Give feedback.
All reactions