-
Notifications
You must be signed in to change notification settings - Fork 29
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
Labels
Comments
Hi @thaithco This is a bug :) Thanks for raising this issue! |
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
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.
The text was updated successfully, but these errors were encountered: