It wasn't mandatory but this is one of the main reasons Underwriter's Laboratory was started. The market needed a certification to say "yes, this things does what it's says it does and in a safe manner".
My dad owned a retail store in the 1970s and he distinctly remember being told "Lots of retailers won't carry a brand/item unless it has the 'UL' sticker on it."