Comparing version 0.1.7 to 0.1.8
@@ -55,16 +55,16 @@ /* | ||
function times(number) { | ||
assert.equal(timesCalled, number); | ||
function times(number, err) { | ||
assert.equal(timesCalled, number, err); | ||
} | ||
function never() { | ||
assert.equal(timesCalled, 0); | ||
function never(err) { | ||
assert.equal(timesCalled, 0, err); | ||
} | ||
function calledOnce() { | ||
assert.equal(timesCalled, 1); | ||
function calledOnce(err) { | ||
assert.equal(timesCalled, 1, err); | ||
} | ||
function calledTwice() { | ||
assert.equal(timesCalled, 2); | ||
function calledTwice(err) { | ||
assert.equal(timesCalled, 2, err); | ||
} | ||
@@ -71,0 +71,0 @@ |
{ | ||
"name": "deride", | ||
"description": "Mocking library based on composition", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"homepage": "https://github.com/REAANDREW/deride", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -249,13 +249,17 @@ # deride [![Build Status](https://travis-ci.org/REAANDREW/deride.svg?branch=master)](https://travis-ci.org/REAANDREW/deride) [![NPM version](https://badge.fury.io/js/deride.svg)](http://badge.fury.io/js/deride) ![Dependencies Status](https://david-dm.org/reaandrew/deride.png) | ||
- v0.1.0 - 22nd April 2014 | ||
First release of the library, pushed into the NPM registry | ||
- First release of the library, pushed into the NPM registry | ||
- v0.1.4 - 24nd April 2014 | ||
Bug fixes and support for different method definition styles | ||
- Bug fixes and support for different method definition styles | ||
- v0.1.5 - 24nd April 2014 | ||
Added feature to support overriding a callback | ||
- Added feature to support overriding a callback | ||
- v0.1.6 - 25th April 2014 | ||
Added feature to support accelerating the timeout used internally by a function | ||
- Added feature to support accelerating the timeout used internally by a function | ||
- v0.1.6 - 25th April 2014 | ||
- Pull request from stono to support custom error messages | ||
- Made the withArgs evaluate equivalence of the args not strict object equality | ||
## License | ||
@@ -262,0 +266,0 @@ Copyright (c) 2014 Andrew Rea |
@@ -137,2 +137,10 @@ /* | ||
it('can return a bespoke error when counting number of invocations', function(done) { | ||
bob = deride.wrap(bob); | ||
assert.throws(function() { | ||
bob.expect.greet.called.times(1, 'This is a bespoke error'); | ||
}, /This is a bespoke error/); | ||
done(); | ||
}); | ||
it('enables convenience method for called.once', function(done) { | ||
@@ -145,2 +153,10 @@ bob = deride.wrap(bob); | ||
it('can return a bespoke error for called once', function(done) { | ||
bob = deride.wrap(bob); | ||
assert.throws(function() { | ||
bob.expect.greet.called.once('This is a bespoke error'); | ||
}, /This is a bespoke error/); | ||
done(); | ||
}); | ||
it('enables convenience method for called.twice', function(done) { | ||
@@ -154,2 +170,10 @@ bob = deride.wrap(bob); | ||
it('can return a bespoke error for called twice', function(done) { | ||
bob = deride.wrap(bob); | ||
assert.throws(function() { | ||
bob.expect.greet.called.twice('This is a bespoke error'); | ||
}, /This is a bespoke error/); | ||
done(); | ||
}); | ||
it('enables the determination that a method has NEVER been called', function(done) { | ||
@@ -161,2 +185,11 @@ bob = deride.wrap(bob); | ||
it('can return a bespoke error for called NEVER', function(done) { | ||
bob = deride.wrap(bob); | ||
bob.greet('alice'); | ||
assert.throws(function() { | ||
bob.expect.greet.called.never('This is a bespoke error'); | ||
}, /This is a bespoke error/); | ||
done(); | ||
}); | ||
it('enables the determination of the args used to invoke the method', function(done) { | ||
@@ -169,3 +202,3 @@ bob = deride.wrap(bob); | ||
}); | ||
it('enables overriding a methods body', function(done) { | ||
@@ -172,0 +205,0 @@ bob = deride.wrap(bob); |
32031
588
269