What command did you use?
Pretty sure that's how it's supposed to work. The effect is applied before the damage is calculated. It's just like shooting an enderman with a spectral arrow. They get the glow effect, but don't take damage.
What command did you use?