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.
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.