In my Blazor projects, the business logic has been tested with xUnit for a long time, but the components themselves were not. If an @if showed the wrong button, I only saw it by opening the page. In this post, we add a bUnit test project to a Blazor application and cover the cases I run into most often.
dotnet watch: you use it for hot reload. You should do more with it.
Every time I changed code, I’d Alt-Tab to the terminal, arrow up, Enter. dotnet test. Wait. Check. Back to the editor. Repeat.
It’s not the end of the world. But over a full day, it adds up, mostly in lost focus. The annoying part is that I already had dotnet watch in my workflow for hot-reloading a web app. I just never thought to ask what else it could do.