Jest spy on functionality

There is the spyOn method, that was introduced with v19 some days ago, that does exactly what you are looking for

Leave a Comment