lolmaus / assertron

Run assertions against your objects. Define contracts with a handy DSL. Test your code inline.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

assertron

Run assertions against your objects. Define contracts with a handy DSL. Test your code inline.

Travis build status Code Climate Test Coverage Dependency Status devDependency Status

Idea

Assertron lets you run assertions against objects via a convenient DSL:

import {assert as A} from 'assertron';

function myFunc(foo, bar) {
  A(foo, {object: true});

  A(bar, {
    optional: true,
    or: {
      number: {
        min: 3,
        max: 10,
        orString: true
      },
      function: true
    }
  })


  /* Your function's code here */
}

About

Run assertions against your objects. Define contracts with a handy DSL. Test your code inline.

License:MIT License


Languages

Language:JavaScript 96.4%Language:HTML 3.6%