This seems like it would be better as `spyOn(console, "error")`