bUnit is a testing library for Blazor Components. You can:
- Setup and define components under tests in C# or Razor syntax
- Verify outcome using semantic HTML diffing/comparison logic
- Interact with and inspect components
- Trigger event handlers
- Provide cascading values
- Inject services
- Mock
IJsRuntime - Perform snapshot testing
The library builds on top of existing unit testing frameworks such as xUnit, which runs the Blazor components tests, just as any normal unit test.
The library's goal is to make it easy to write comprehensive, stable unit tests for Blazor Components/Razor Components. Go to bUnit.egilhansen.com to learn more.
These are the current goals that should be reached before v1.0.0 is ready:
- Stabilize the APIs, such that they work equally well with both xUnit, Nunit, and MSTest as the underlying test framework. The general goals is to make it easy and obvious for developers to create the tests they needed, and fall into the pit of success.
- Get the Razor-based testing to stable, e.g. make the discovery and running of tests defined in .razor files stable and efficient. This includes adding support for Nunit and MSTest as test runners.
- Improve the documentation. Currently there are a list of "How to" guides planned in the Update Docs milestone.
- Join the .NET Foundation.. This project is too large for one person to be the owner and be the sole maintainer of, so the plan is to apply for membership as soon as possible, most likely close to or after v1.0.0 ships, and get the needed support and guidance to ensure the project long term.
In the post v1.0.0 to v1.0.x time frame, focus will be on improving performance. Especially the spin-up time of about one second would be nice to get reduced.
Shout outs and a big thank you to all the contributors to the library, both those that raise issues, provide input to issues, and those who send pull requests.