/assertron

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

Primary LanguageJavaScriptMIT LicenseMIT

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 */
}