Describe the bug
When calling JSON.stringify on Substitute I will receive undefined. While I understand that it is hard to decide what should be returned I would expect at least something and not undefined.
I think that the toJSON() function could be employed here to define some behavior.
To Reproduce
interface Obj {
hello: string
}
const sub = Substitute.for<Obj>()
sub.hello.returns('world')
JSON.stringify(sub) // undefined
Describe the bug
When calling
JSON.stringifyon Substitute I will receiveundefined. While I understand that it is hard to decide what should be returned I would expect at least something and notundefined.I think that the
toJSON()function could be employed here to define some behavior.To Reproduce