The kind of USB charger cable you mean is missing the D+ and D- data lines. It simply doesn't have those wires inside the cable.
You can test for continuity or resistance using a multimeter. Probe between the corresponding data pins: D+ on one side to D+ on the other, or D- to D-. The D+/D- lines are the middle two pins of a USB connector. Just select one on one side of the cable, and test continuity to both of the middle pins on the other side.
You will see no continuity or a high/"infinite" resistance on your meter if the cable is missing data wires and is a "charge only cable".
Technically USB charger cable requires the data lines to request more power from a host device, so a cable missing these connections would, in theory, only let devices charge very slowly. In practice most USB hosts will not enforce such a limit. It is also possible that some phones will refuse to charge without data lines in the cable.