How can I offer a test ride while selling a bike? I am selling a bike to someone I don't know from Craigslist. I expect that the prospective purchaser will want to test ride the bike before making the purchase.

How can I prevent  them from riding away with my bike during a test ride?
The simplest answers are ask for their ID, or for their car keys if they arrive by car. There are plenty of other options on various forums like

https://www.bikeforums.net/general-cycling-discussion/446194-selling-bike-craigslist-test-rides.html

https://www.bikeforums.net/general-cycling-discussion/687171-how-do-you-let-potential-buyer-test-ride-your-bike.html