Permalink
Browse files

Add a test for undefined spy

Shows that #71 (comment) is not accurate.
  • Loading branch information...
1 parent 05ab682 commit 4397aa15f5a6c01539b9f1f4b9798a6d5b3e31f0 @domenic committed Dec 20, 2015
Showing with 3 additions and 0 deletions.
  1. +3 −0 test/callCount.coffee
@@ -9,6 +9,9 @@ describe "Call count", ->
spy = sinon.spy()
describe "called", ->
+ it "should throw an assertion error when the spy is undefined", ->
+ expect(-> expect(undefined).to.have.been.called).to.throw(TypeError)
@fearphage
fearphage Oct 1, 2016

The assertion doesn't match the label. You're checking for TypeError, but the label says it should throw AssertionError.

@domenic
domenic Oct 1, 2016 Owner

Thanks. Pull request to fix the label welcome.

+
it "should throw an assertion error when the spy is not called", ->
expect(-> spy.should.have.been.called).to.throw(AssertionError)

0 comments on commit 4397aa1

Please sign in to comment.