--This isnt the whole answer, but its the hard part, just get to know JsTestDriver and this will make sense, this needs to be a function inside the test file where you have the test functions for the embedded JS--
var url = "/test/<path to your html file>";
var request = new XMLHttpRequest();
request.open('GET', url, false);
request.send(null);
var doc = document.implementation.createHTMLDocument("SomeTitle");
doc.documentElement.innerHTML = request.responseText;
var allScripts = doc.scripts;
var script = allScripts.item(#);//the # is the specific script you want, look up .item()
var scriptline = script.innerHTML.replace(/\s/g, ' ');//everything needs to be in one line
var script2 = document.createElement('script');
script2.innerHTML = sample;
var h = document.getElementsByTagName('head')[0];
h.appendChild(script2);
YOUR ALL WELCOME!