"Dramatic irony" is the term. Dramatic irony occurs in a work of literature (such as short story, a play, a novel, or a film) when the audience or reader is aware of a piece (or pieces) of information that one or more character in the story is not aware of.