Since 3.9 there's Joomla\CMS\Router\Route::link() method which takes client (site or administrator) as first argument.
$link = 'index.php?option=com_content&view=article&id=1';
echo '<a href="' . JRoute::link('site', $link) . '">Test</a>';
If you have the article object available, you should use ContentHelperRoute::getArticleRoute() and pass the slug instead of ID to remove extra database query and also category and language to ensure correct routing.
// Register helper class.
JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php');
$link = ContentHelperRoute::getArticleRoute($article->id . ':' . $article->alias, $article->catid, $article->language);
echo '<a href="' . JRoute::link('site', $link) . '">Test</a>';