-
-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working