Git Product home page Git Product logo

hassanhabib / bunit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bunit-dev/bunit

0.0 2.0 0.0 3.33 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.egilhansen.com

License: MIT License

C# 94.68% HTML 5.32%

bunit's Introduction

GitHub Workflow Status GitHub tag (latest SemVer pre-release) 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. You can:

  • Setup and define components under tests in C# or Razor syntax
  • Verify outcome using semantic HTML comparer
  • Interact with and inspect components
  • Trigger event handlers
  • Provide cascading values
  • Inject services
  • Mock IJsRuntime
  • Perform snapshot testing

bUnit builds on top of existing unit testing frameworks such as xUnit, NUnit, and MSTest, which runs the Blazor components tests, just as any normal unit test.

Go to bUnit.egilhansen.com to learn more.

NuGet downloads

bUnit is available on NuGet in various incarnations. If you are using xUnit as your general purpose testing framework, you can use bunit, which includes everything in one package. If you want to use NUnit or MStest, then pick bunit.core and bunit.web:

Name Type NuGet Download Link
bUnit Library, includes core, web, and xUnit Nuget
bUnit.core Library, only core Nuget
bUnit.web Library, web and core Nuget
bUnit.xUnit Library, xUnit and core Nuget
bUnit.template Template, which currently creates an xUnit based bUnit test projects only Nuget

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

Sponsors

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

Milestones to v1.0.0

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.

Contributors

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. Thank you!

bunit's People

Contributors

danielabbatt avatar darthpedro avatar duracellko avatar egil avatar iambacon avatar kasperhesthaven avatar samtrion avatar simoncropp avatar siphonophora avatar stefh avatar yourilima avatar

Watchers

 avatar  avatar

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.