you can't write
document.location.href="{{ path('ymtest_Delete'"+types+", {'id': "+id+"}) }}";
you are mixing twig functions and javascript functions. Twig will be parsed and compiled on backend Javascript will be executed on your client side after the html page is received
You will have to generate and assign each url type to a javascript variable.
a more elegant way to do that would be to store your url and messages in data attributes
<a class="Right btn btn-danger" data-url="{{ path('ymtest_EditMusician', {'id': artist.id}) }}" data-message="Are you sure you want to delete this type ?" ></a>
you can now bind your event click with javscript and retrieve your data attributes values. No more javascript tests