Coder Social home page Coder Social logo

assert's Introduction

Assert

A set of advanced assertions for Pester to simplify how you write tests.

Features

Syntax you don't have to learn

Assertions use approved verb Assert and one function per assertion so you can leverage all your command discovery skills.

Specialized assertions

Assertions are split to generic and specialized. Use the generic assertion to the basic stuff and the specialized assertion to get more fancy. No more guessing what -Exactly means for the current type. More types coming soon.

Helpful failure messages

Assertions provide verbose failure messages that describe what the input was, what the output was, and why the assertion failed.

Custom failure messages

Bored by standard assertion messages, or they simply don't make much sense for your usecase? Don't worry, you can write your own.

Nicely formatted output

Most objects do not print nicely, so we try hard to fix it for you so you know exactly what the input and output of your tests was. Say no to "Assertion failed because '' was not equal to ''."

Well tested

The whole suite was written mostly test first, it currently has 417 tests and growing. (Yes that is almost as many tests as Pester has for the whole framework!) A simplified set of independent assertions is used to test the code to make sure everything is working correctly without unwanted dependencies.

Build status

Comparing whole objects

experimental!

Got two objects and you need to know how exactly they differ? With this experimential feature you can compare whole objects and get detailed report of their differences. Get in touch and help me throw a lot of testcases on this assertion to make it better!

Chaining assertions

experimental!

Assertions pass their input to their output so you can easily chain them. Awesome for quick prototyping or when you are missing a complex assertion. Not recommended for production, because of assertion rullette. Be a hero and suggest a way to chain assertions and fail all of them at the same time.

Setup

  1. Install

Install for the current user by running the following:

Install-Module -Scope CurrentUser -Name Assert

Or install for all users by running this from and administrator PowerShell commandline:

Install-Module -Name Assert
  1. Import Import the module in your current powershell session by:
Import-Module Assert
  1. Use it anywhere!
"hello" | Assert-NotEqual "world" 

Help needed

Best way to help, is to start using this module and report bugs and feature requests. I have big plans, but my tests are still the same, so every new pair of eyes is welcome. :)

assert's People

Contributors

bergmeister avatar ili101 avatar nohwnd avatar stuartleeks avatar

Watchers

 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.