assert-match
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "assert-match", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "assert's matching features", | ||
@@ -5,0 +5,0 @@ "main": "dst/index.js", |
@@ -12,2 +12,15 @@ [](https://travis-ci.org/rmdm/assert-match) | ||
Rationale | ||
========= | ||
There are times when I need to check only subset of an object porperties to have | ||
specific values. Hence this module. An alternative approach would be to use a | ||
combination of standard `assert` and some utility library providing matching | ||
capability, for example `_.isMatch`. `assert-match` has the following | ||
advantages: | ||
- it provides your test runner with the hints on actual and expected | ||
outcomes of the test | ||
- gives your more consistent results with family of standard `deep`-assertions | ||
Installation | ||
@@ -20,9 +33,9 @@ ============ | ||
Assertions | ||
========== | ||
Usage | ||
===== | ||
### ```assert (obj)``` | ||
The function returned by imported module. Can be used to extend any passed | ||
**obj** object in it, for example, standard `assert` module: | ||
The function returned by the module. Can be used to extend any passed **obj** | ||
object in it, for example, standard `assert` module: | ||
@@ -48,2 +61,5 @@ ```javascript | ||
Assertions | ||
---------- | ||
### ```assert.match (actual, expected, message)``` | ||
@@ -77,3 +93,3 @@ | ||
import assert from 'assert' | ||
import assert from 'assert-match' | ||
@@ -80,0 +96,0 @@ describe('examples', function () { |
11496
135