Skip to content

fail() throws exception on assertThrows when method was not called #12

Closed
ebunders opened this Issue Oct 1, 2011 · 2 comments

2 participants

@ebunders
ebunders commented Oct 1, 2011

When you add a method to the mock that you explicitely don't want to be called, but afterwards call mock.assertThrows, becouse there was another method that did have to be called, fail() throws an error, even if that method was not called.

I wrote a little test to illustrate the problem (it fails):

exports.testFailThrowsNoExceptionWhenNotCalled = function(test){
var mock = nm.mock('test').fail();
test.doesNotThrow(function() {
// the method was not called so, no exception should be thrown
mock.assertThrows();
});
test.done();

}

@arunoda arunoda added a commit that referenced this issue Oct 1, 2011
@arunoda Fixed issue #12
  fail() throws exception on assertThrows when method was not called
1a34453
@arunoda arunoda closed this Oct 1, 2011
@arunoda
Owner
arunoda commented Oct 1, 2011

Yes that was an issue :)
I just fix that. Thanks for showing up.
And updated the NPM too. (version 0.2.15)

@ebunders

no problem,
cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.