In Harry Potter and the Prisoner of Azkaban when they are learning the truth about Sirius, they all hear a creak behind Lupin and the door opens by itself. We go on to learn that the Marauders are animagi. Then Snape reveals himself.
Was he listening under the invisibility cloak the whole time since they heard the creak? If so, Snape would know Sirius is an animagus. Then why was he shocked at the end of Harry Potter and the Goblet of Fire in the hospital wing when Sirius transformed from dog to man?