very-assertive

An Assertion library for Should.js defining a descriptive object comparator indicating how two objects differ (i.e. which properties have been modified / deleted / added)

npm install very-assertive
19 downloads in the last week
42 downloads in the last month

very-assertive

Build Status

A collection of node.js should library assertions

using

very-assertive mixes in with other should assertions, therefore all you need to do is require it...


require 'very-assertive'

equalObject

print detailed info on differences between JS objects... handy for large object comparisons.

one = {nice: 'one'}
two = {nice: 'two'}

one.should.equalObject one
one.should.not.equalObject two

equalArray

print detailed info on differences between JS arrays.

one = [1,2,3]
two = [4,5,6]

one.should.equalArray one
one.should.not.equalArray two

example output

This failing test:

{missing:'content', stable: 'unchanged'}.should.equalObject {newProperty: 'added', stable: 'unchanged'}

will output hash differences like:

Example

npm loves you