18650 battery tester (current, not voltage)

If you test a battery under load, of course you are discharging it... Typically, you'd do that to test the condition of the battery or it's ability to hold a charge, and then you'd re-charge it immediately after the test. If you think the battery is going dead and you're not going to recharge it, the last thing you want to do is pull current out of it for a test!

I think computers (and phones) use an algorithm... By measuring the current drain while monitoring voltage you can calculate/estimate how many amp-hours have been used and how many remain.