4.0.2 • Published 10 years ago

asserts v4.0.2

Weekly downloads
383
License
MIT
Repository
github
Last release
10 years ago

Description

Test grouping and formatting to make working with vanilla node assert marginally easier

Latest Version

4.0.2

Installation

npm install asserts --save

or in package.json

{
  ...
  "dependencies": {
    "asserts": "4.0.2"
  }
}

Usage

NOTE: Examples below work but are out of date in demonstrating current functionality (particularly async support, .dir, and .all.*) check test/test.js for better examples.

examples/happy.js looks like this:

var Assert = require('assert');
var Asserts = require('asserts');

Asserts({
  foo : function() {
    Assert.equal("something", "something", "optional message");
    Assert.equal(2, 2);
  },
  barf : {
    ing : function () {
      Assert.equal(1, 1, "okay");
    },
    ed : function() {
      Assert.equal(2, 2, "yep");
    }
  }
});

and when run looks like this:

npm.io

examples/sad.js looks like this:

var Assert = require('assert');
var Asserts = require('asserts');

Asserts({
  "foo": function() {
    Assert.equal("something", "something", "optional message");
    Assert.equal(2, 2);
  },
  "barf" : {
    "ing": function () {
      Assert.equal(1, 1, "okay");
    },
    "ed": function() {
      Assert.equal(2, 3, "yep");
    },
    "o": {
      "rama": function() {
        Assert.equal(2, 10, "MATH");
      },
      "hnooooo": function() {
        Assert.equal(1, 1);
      }
    }
  },
  "meh": function() {
    Assert.equal(1, 2, "oh nooooo");
  }
});

and when run looks like this:

npm.io

Check test/test.js for example of Asserts.dir and Asserts.'equal', 'notEqual', 'deepEqual', 'notDeepEqual', 'strictEqual', 'notStrictEqual'

#TODO

add better documentation for 4.0.0 stuff - async support, .all., .dir

#Build status build status

4.0.2

10 years ago

4.0.1

10 years ago

4.0.0

11 years ago

3.1.1

11 years ago

3.1.0

11 years ago

3.0.0

12 years ago

2.2.0

12 years ago

2.1.0

12 years ago

2.0.0

12 years ago

1.0.1

12 years ago

1.0.0

12 years ago

0.4.2

12 years ago

0.4.1

12 years ago

0.4.0

12 years ago

0.3.1

12 years ago

0.3.0

12 years ago