Coder Social home page Coder Social logo

magicianred / bunit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bunit-dev/bunit

1.0 0.0 1.0 4.67 MB

A testing library for Blazor Components. You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can easily interact with and inspect components, trigger event handlers, provide cascading values, inject services, mock IJSRuntime, and perform snapshot testing.

Home Page: https://bunit.dev

License: MIT License

C# 95.88% HTML 4.00% CSS 0.01% PowerShell 0.12%

bunit's Introduction

GitHub tag Nuget Issues Open Gitter

bUnit - a testing library for Blazor components

bUnit is a testing library for Blazor Components. Its goal is to make it easy to write comprehensive, stable unit tests. With bUnit, you can:

  • Setup and define components under tests using C# or Razor syntax
  • Verify outcomes using semantic HTML comparer
  • Interact with and inspect components as well as trigger event handlers
  • Pass parameters, cascading values and inject services into components under test
  • Mock IJSRuntime, Blazor authentication and authorization, and others

bUnit builds on top of existing unit testing frameworks such as xUnit, NUnit, and MSTest, which run the Blazor component tests in just the same way as any normal unit test. bUnit runs a test in milliseconds, compared to browser-based UI tests which usually take seconds to run.

Go to bUnit.dev to learn more.

NuGet Downloads

bUnit is available on NuGet in various incarnations. Most should just pick the bUnit package:

Name Description NuGet Download Link
bUnit Includes the bUnit.core and bUnit.web packages. Nuget
bUnit.core Core library that enables rendering a Blazor component in a test context. Nuget
bUnit.web Adds support for testing Blazor components for the web. This includes bUnit.core. Nuget
bUnit.template Template, which currently creates xUnit-based bUnit test projects only Nuget

To get started, head to the getting started documentation to learn more.

Sponsors

A huge thank you to the sponsors of my work with bUnit. The higher tier sponsors are:

@syncfusion
Syncfusion
@Progress-Telerik
Progress-Telerik
Hassan Rezk Habib (@hassanhabib)
Hassan Rezk Habib

Contributors

Shout outs and a big thank you to all the contributors to the library, including those that raise issues, provide input to issues, and those who send pull requests. Thank you!

bunit's People

Contributors

bunitbot avatar christian-oleson avatar danielabbatt avatar darthpedro avatar dependabot[bot] avatar duracellko avatar edcharbeneau avatar egil avatar hamedmoghadasi avatar iambacon avatar ivanrainbolt avatar jeroenbos-testserviceuser avatar joro550 avatar kasperhesthaven avatar kristofferstrube avatar lewis-allen avatar nemesv avatar pharry22 avatar samtrion avatar simoncropp avatar siphonophora avatar stefh avatar thalaeg avatar thopdev avatar ventigrande avatar yourilima avatar

Stargazers

 avatar

Forkers

muskanmahajan37

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.