Jasmine test fails running in VS2012 + Resharper + PhantomJS

后端 未结 1 807
南旧
南旧 2021-01-22 14:15

I tried to run a jasmine unit test in resharper 7 in vs2012 but its failing.

\"enter

1条回答
  •  无人及你
    2021-01-22 14:54

    No, you can't change the url. But what is causing your test to fail is most likely a missing file reference. What you can do is to debug the test and check the loaded file references and see what is missing:

    1. Run the tests in a standard browser (Chrome) instead of PhantomJS, you can set it up in:

    Resharper -> Options -> Tools -> Unit Testing -> JavaScript Tests -> Run Tests with...

    1. Add this line of code before your test:

    jasmine.getEnv().currentRunner().finishCallback = function () { };

    This will override the finishCallback function which is called to notify Resharper about test being finished, so the test wil run forever and you can refresh it by hitting F5 and debug indefinitely. You only must stop the test manually then in Resharper's Unit Test Sessions window.

    0 讨论(0)
提交回复
热议问题