1
votes

When running jasmine test with resharper in a browser or phantom, I notice it starts with a random port like (localhost:2341), is it possible to tell resharper that we want to run the tests in a specific port?

I whould like to do this because my application is running in a specific port, and I cannot require a view in my tests since it whould be a cross domain request, requirejs/text won't let me.

thanks :)

2
some configuration code / log output would be sweet. - angabriel

2 Answers

1
votes

Sadly, it's not configurable at all. I'd suggest adding a feature request here: http://youtrack.jetbrains.com/issues/RSRP#newissue=yes

0
votes

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();
    });
});