Currently, I have a function that sometimes return an object with some functions inside. When using expect(...).toEqual({...}) it doesn’t seem to match those complex objects. Objects having functions or the File class (from input type file), it just can’t. How to overcome this?
Currently, I have a function that sometimes return an object with some functions inside.
Share
As Vlad Magdalin pointed out in the comments, making the object to a JSON string, it can be as deep as it is, and functions and File/FileList class. Of course, instead of
toString()on the function, it could just be called ‘Function’