sinon icon indicating copy to clipboard operation
sinon copied to clipboard

spy should support the same signature as stub for objects

Open benawhite opened this issue 7 years ago • 1 comments

  • 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();

benawhite avatar May 22 '19 15:05 benawhite

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.

stale[bot] avatar Jul 21 '19 17:07 stale[bot]