mjackson / expect

Write better assertions
MIT License
2.29k stars 117 forks source link

how to test called times? #220

Closed clownvary closed 7 years ago

clownvary commented 7 years ago

per title, is there any way to test a method called times, like xx.toHaveBeenCalledOnce/twice, etc. Thanks.

ljharb commented 7 years ago

expect(spy.calls).to.have.lengthOf(3)?

clownvary commented 7 years ago

it works for me , thank u.