targos/should-approximately-deep


Extend should.js to assert arrays with approximate values

License: MIT

Language: JavaScript


should-approximately-deep

NPM version build status npm download

Extend should.js to assert arrays with approximate values

Installation

npm install should-approximately-deep --save-dev
require('should-approximately-deep');

Usage

approximatelyDeep(otherValue, delta)

Asserts if a chained object is a number or a (potentially multidimensional) array of numbers and that its values are near the ones from otherValue within the delta margin. Each array must have the same number of elements.

[1, 2, 3].should.be.approximatelyDeep([1, 2.01, 2.99], 0.1);
[1, 2, 3].should.not.be.approximatelyDeep([1, 2], 0.1);
[[1, 2, 3], [4, 5, 6]].should.be.approximatelyDeep([[1.05, 1.95, 3],[4, 4.98, 6]], 0.1);

License

MIT

Project Statistics

Sourcerank 6
Repository Size 184 KB
Stars 1
Forks 0
Watchers 2
Open issues 0
Dependencies 3
Contributors 1
Tags 3
Created
Last updated
Last pushed

Top Contributors See all

Michaël Zasso

Packages Referencing this Repo

should-approximately-deep
Extend should.js to assert arrays with approximate values
Latest release 1.1.0 - Updated - 1 stars

Recent Tags See all

v1.1.0 June 11, 2015
v1.0.1 October 22, 2014
v1.0.0 October 22, 2014

Something wrong with this page? Make a suggestion

Last synced: 2017-09-01 14:37:21 UTC

Login to resync this repository