Is it possible to test out of a community college class (for undergrad requirements before transfer)

That’s surprising to me. If UC’s don’t accept transferable credits that come from community colleges, just because you’ve clepped out of them, why do community colleges offer this option in the first place? I understand getting an AA/AS more quickly, but being able to finish up your undergrad requirements at a CC faster by clepping and then transferring seems like a huge reason as well. Are you really sure that any courses I clep out of at a CC won’t count towards a UC?