so, there is no way to run the tests in a specific port, my work-around for this issue was to enable the cross domain request by putting this on the application web.config
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
</customHeaders>
</httpProtocol>
</system.webServer>
that way I was able to load views with jquery load.
it("should load the view", function () {
var viewLoaded;
var viewSuccessfullyLoaded;
$('body').load('http://localhost:8080/app/views/view.html', function(response, status) {
if (status == "error")
viewSuccessfullyLoaded = false;
if (status == "success")
viewSuccessfullyLoaded = true;
viewLoaded = true;
});
//wait for the view to be loaded before evaluating the expectation
waitsFor(function() {
return viewLoaded;
}, "loading view", 500);
runs(function() {
expect(viewSuccessfullyLoaded).toBeTruthy();
});
});