Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spy.interface documentation appears to be wrong #99

Closed
thaithcock opened this issue Apr 13, 2018 · 2 comments
Closed

spy.interface documentation appears to be wrong #99

thaithcock opened this issue Apr 13, 2018 · 2 comments

Comments

@thaithcock
Copy link

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
Copy link
Contributor

stalniy commented Apr 14, 2018

Hi @thaithco

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

@jazzzz
Copy link

jazzzz commented Jul 3, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants