This may fall under a practical joke which ranges from tricking people into believing something frankly preposterous to painting someone's banister in honey. It may also be referred to as a hoax or ruse as stated by Prof yattle.
Edit: upon further consideration, this is a case of somebody kidding you. Often somebody will say, after fooling you: "just kidding".