Those who hold Visitor visas are required to pay for any NHS treatment they receive, at a rate of 150% of the cost of treatment, and we normally advise that they should have private medical insurance during their visit to the UK.
Government guidance, found at: https://www.gov.uk/guidance/nhs-entitlements-migrant-health-guide , however, makes clear that no charges or immigration checks will apply for coronavirus testing and/or treatment:
There can be no charge made to an overseas visitor for the diagnosis or treatment of coronavirus (COVID-19).
All overseas visitors, including anyone living in the UK without permission, should be aware that:
No charges apply to testing for COVID-19, even if the result is negative, or to any treatment provided for COVID-19 if the result is positive or up to the point that it is negatively diagnosed. The same is true of most other infectious diseases.
NHS trusts have been advised that no immigration checks are required for overseas visitors that are known to be only undergoing testing or treatment for COVID-19.