In the early days of television, stations would sign off at midnight.
During the era of black and white analog tvs after sign off, a test card would be displayed. The card was used to check different elements of the display like brightness/contrast, amplitude distortion of the receiver, vertical/horizontal resolution, high/low frequencies, etc.
Once tvs moved to digital, the channels would play a Star Spangled Banner video sometimes on a loop.