-
-
Notifications
You must be signed in to change notification settings - Fork 780
Closed
Description
Version: 15.0.1
Assuming a class instance like so
class Thing {
aMethod() {}
}
const thing = new Thing();and a spy like so
sinon.spy(thing, 'aMethod');a global restore will error
sinon.restore();This is because sinon attempts to directly set target[property] back to the original method, which is caught by the spy proxy.
Example Error:
TypeError: Cannot assign to read only property 'setRequestReviewers' of object '[object Object]'
at Function.restore
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels