Releases: bUnit-dev/bUnit
1.26.64
Changed
- Upgraded AngleSharp to 1.0.7.
Fixed
- When the
TestContextwas disposed, the Blazor Renderer itself didn't dispose components under test. By @linkdotnet. - When navigating, the
HistoryEntryStateonNavigationManagerwill be populated. By @linkdotnet.
Added
- New overloads for
IRenderedFragmentBase.InvokeAsyncthat allow retrieving the work item's return value. By @jcparkyn.
1.25.3
- Upgrade all .NET 8 preview dependencies to .NET 8 stable.
1.24.10
Fixed
- When the
TestContextwas disposed, it disposed of all services via the service provider. However, if there were ongoing renders happening, this could cause inconsistent state in the render tree, since theTestRenderercould try to access the service provider to instantiate components.
This release changes the dispose phase such that the renderer gets disposed first, then the service provider. The disposal of any services that implementIAsyncDisposableis now also awaited. Fixed by @egil and @linkdotnet. Reported by @BenSchoen in #1227.
Added
-
Support for custom service provider factories (
IServiceProviderFactory<TContainerBuilder>). This enables the use of Autofac and other frameworks for dependency injection like on real-world ASP.NET Core / Blazor projects. By @inf9144. -
Ability to raise the
oncancelandoncloseevent, that was introduced with .NET 8.
1.23.9
Fixed
- If the renderer was not idle when calling
SetParametersAndRender, the method could return before the parameters were set and the component under test had finished rendering. This was a regression that happened in v1.21.9. Reported by @Skintkingle in #1188. Fixed by @egil.
Added
net8.0support- Increased timeout of
WaitForAssertionto infinite when a debugger is attached. By @linkdotnet.
Fixed
- AngleSharp IElement extension methods do not work with
IRenderedFragment.Find. Reported by a2er. Fixed by @linkdotnet.
1.22.19
Added
- Update bunit templates to support the target framework version of the project. By @linkdotnet.
Fixed
-
Calling
MarkupMatches(RenderFragment)from a lambda passed to e.g.WaitForAssertioncould lead to a deadlock in certain circumstances. Fixed by @linkdotnet. Reported by @uecasm in #1143. -
Rendering complex component hierarchies could result in a stack overflow. Fixed by @egil.. Reported by @groogiam in #1064.
-
Remove capturing and dispatching markup updates to test frameworks synchronization context again. This could cause deadlocks and does not have any impact on test stability. Fixed by @egil. Reported by @biohazard999 in #1144.
1.21.9
Fixed
-
Allow using 3rd party
IComponentActivatorat the same time as component factories. By @egil. Reported by BenSchoen in #1129. -
Calling
IRenderedComponent.Render()orIRenderedComponent.SetParametersAndRender()did not batch up multiple synchronous re-renders after setting parameters. This is now changed such that the method causes the component to re-render with new parameters in the same way as if a parent component had passed new parameters to it. By @egil. Reported by @Jcparkyn in #1119.
1.20.8
Added
- Added static
DefaultWaitTimeoutproperty toTestContextto enable overriding the default timeout of "wait for" methods likeWaitForAssertionfrom 1 second to something else. By @egil.
Fixed
- TestRenderer throws
ObjectDisposedExceptionif any methods is accessed after it has been disposed. It will also prevent changes to the internal render tree after it has been disposed. By @egil.
1.19.14
Fixed
- Custom elements with attributes throw
ArgumentExceptionwithMarkupMatches. Reported by @candritzky. Fixed by @linkdotnet.
Changed
- Changed test renderer such that updates to rendered components markup happen in the same synchronization context as the test framework is using (if any), if any, to avoid memory race conditions. By @egil.
1.18.4
Fixed
- Some characters where not properly escaped. Reported by @pwhe23. Fixed by @linkdotnet.
- Clicking a submit button or submit input element inside a form, submits the form, if the submit button or submit input element does not have the
@onclick:preventDefaultattribute set. Reported by @linkdotnet. Fixed by @egil.
1.17.2
- Submit buttons and input fields now no longer cause a form submit when they have the
@onclick:preventDefaultattribute. By @JelleHissink.