Fix expectDeprecation with callback.