Skip to content

Instantly share code, notes, and snippets.

@rclark
Last active September 10, 2016 21:29
Show Gist options
  • Save rclark/51b839321f4e184b3f38e3c398a9f7f7 to your computer and use it in GitHub Desktop.
Save rclark/51b839321f4e184b3f38e3c398a9f7f7 to your computer and use it in GitHub Desktop.
~/tmp/nope 》node --version
v4.4.7

~/tmp/nope 》npm install sinon@2.0.0-pre.2
sinon@2.0.0-pre.2 ../node_modules/sinon
├── samsam@1.2.1
├── text-encoding@0.5.2
├── lolex@1.5.1
└── formatio@1.1.1 (samsam@1.1.3)

~/tmp/nope 》node
> var sinon = require('sinon');
> var obj = { get foo() { return 'foo'; }, set foo(bar) {} };
> var stub = sinon.stub(obj, 'foo');
TypeError: Attempted to wrap undefined property foo as function
    at checkWrappedMethod (/Users/r/tmp/node_modules/sinon/lib/sinon/util/core/wrap-method.js:37:21)
    at wrapMethod (/Users/r/tmp/node_modules/sinon/lib/sinon/util/core/wrap-method.js:80:13)
    at Object.stub (/Users/r/tmp/node_modules/sinon/lib/sinon/stub.js:74:12)
    at repl:1:18
    at REPLServer.defaultEval (repl.js:262:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:431:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment