Seems weird to use this implementation rather than `spyOn`, but I'm not *against* it.