11 Testing your Blazor application

This chapter covers

  • Creating a bUnit test project
  • Writing tests that verify rendered markup
  • Mocking authentication and authorization in tests
  • Testing components that use JavaScript interop

Testing is a very important aspect of writing applications. When we have good tests in place, we can produce higher quality applications, faster—Blazor applications are no exception. When it comes to testing Blazor apps, the three most common programmatic testing options are:

  • Unit testing

  • Integration testing

  • End-to-end testing

Unit testing is the lowest level of testing we can utilize. When writing these types of tests, we focus on testing the smallest piece of functionality we can—such as a single method in a class. ...

Get Blazor in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.