chaijs / chai-spies

Spies for Chai Assertion Library.
MIT License
132 stars 29 forks source link

spy.interface documentation appears to be wrong #99

Closed thaithcock closed 6 years ago

thaithcock commented 6 years ago

Looking at the interface documentation it seems to be slightly incorrect if you try and create an object through the array-of-keys syntax.

Particularly, it says you can do something like chai.spy.interface(['on', 'off', 'emit']);.

However, looking at the tests, there is no such expectation of being able to create an interface in that way. You need to pass a "base class" to create the interface from, like chai.spy.interface("Object", ['on', 'off', 'emit']);.

Creating an interface in the way the documentation suggests creates a weird object with integer keys, which is not quite what you want.

stalniy commented 6 years ago

Hi @thaithco

This is a bug :) Thanks for raising this issue!

jazzzz commented 5 years ago

The documentation on chaijs.com is still not up to date, would it be possible to update it?