Skip to content

Commit

Permalink
Add a test for undefined spy
Browse files Browse the repository at this point in the history
Shows that #71 (comment) is not accurate.
  • Loading branch information
domenic committed Dec 20, 2015
1 parent 05ab682 commit 4397aa1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/callCount.coffee
Expand Up @@ -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)

This comment has been minimized.

Copy link
@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.

This comment has been minimized.

Copy link
@domenic

domenic Oct 1, 2016

Author 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)

Expand Down

0 comments on commit 4397aa1

Please sign in to comment.