How do manufacturers of ham radio equipment test the devices they sell without violating laws against commercial use of ham radio frequencies?
Many RF equipment tests can be done using well shielded and tapped dummy loads, programmable signal generators with adjustable attenuators, and/or other suitable laboratory test and measurement equipment.
I test one of my dual port full duplex transceiver kits by running the transmitter output via shielded coax thru a calibrated attenuator back into the receiver, or into an oscilloscope or spectrum analyzer (tinySA) to cross check the test measurements.
A dummy load allows an engineer to simulate an antenna whilst absorbing most if not all of the RF load.
A frequency counter allows an engineer to measure the frequency and can assist with fine adjustment of the transceiver's transmitter circuits.
A signal generator generates a signal that can mimic an incoming transmission allowing receive adjustment and optimisation.
Power Meter (aka Wattmeter)
A power meter facilitates measurement and fine adjustment of the output power (watts output) of the transmitter.
Of course, there are many other tools and equipment. This reply is designed to be a succinct answer to the question.