sinon
sinon copied to clipboard
spy should support the same signature as stub for objects
- Sinon version : v7.3.2
- Environment : node
- Example URL : n/a
- Other libraries you are using: n/a
What did you expect to happen? I would expect that I could spy on all methods of an object without explicitly calling out each method by name... the same a stub
What actually happens TypeError: Attempted to wrap undefined property undefined as function
How to reproduce
// create sandbox
const sandbox = sinon.createSandbox();
// all methods should be spied
sandbox.spy(console); // actually throws error
// ... do some stuff here ...
// restore back to original
sandbox.restore();
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.