Astronomers have captured rare images of a tiny star before, during and after it exploded as a "classical nova".