It's the same rule as with enemies. If you are within range when casting time is over, it is a hit. Unless -as stated earlier- caster dies during animation.