Resharper jasmine javascript tests: "Failed test run" error

Here is the test:

myview-model.specs.js :

 describe('Total truth', function() { it('true', function() { expect(true).toBe(true); }); }); 

When I run Resharper 9, it fails with "Inconclusive: Test not run" for Total truth when it is with phantomjs.exe

+5
source share
2 answers

In case someone comes here, the problem was not in Visual Studio or Resharper, but phantomjs had an error:

 > C:\PhantomJS\bin\phantomjs.exe Auto configuration failed 11888:error:02001015:system library:fopen:Is a directory:.\crypto\bio\bss_file.c:169:fopen('F:\development\openssl\!BUILD/ssl/openssl.cnf','rb') 11888:error:2006D002:BIO routines:BIO_new_file:system lib:.\crypto\bio\bss_file.c:174: 11888:error:0E078002:configuration file routines:DEF_LOAD:system lib:.\crypto\conf\conf_def.c:199: 

So, after pointing out the correct phantoms, this works.

+1
source

As for the initial tests, this should not fail through cli. Refuse the first test with grunt cli if you receive errors with tests.

The topic issue was resolved this way:

  • Add angular and other libraries to your C # project (it’s preferable to link Add-> Existing Item-> Pick β†’ (small down arrow) β†’ Add as link). E.g. I added to the views folder from the npm module folder outside the project.
  • Add the nuget JasmineTest package (Jasmine Test Framework).
  • Add the System.Web.Mvc link. (4.0.0 works great)
  • Add /// < s reference path to spec.js. (tests.js)

    /// <reference path = "~ / Views / angular.js" /> /// <reference path = "~ / Views / angular-mocks.js" /> /// <reference path = "~ / .. /OtherProject/frontend/core/myController.ctrl.js"/> describe ('app.core.myControllerCtrl', function () {

  1. Disable QUnit. QUnit runner is trying to run tests from the angular -mock.module function. (RESHARPER-> Options-> Tools-> Unit Testing-> JavaScript Tests-> Supported Framework)

  2. Run your tests through ReSharper.

As for myController.ctrl.js - it is related to BrOtherProject, but you may need to link it in the same way as the angular library.


Bad links posted in the editor. Offers are available only for the project area.

By the way, Resharper starts a local server and opens a browser page. You can track errors on a page in browser-dev to find out which dependency has been broken.


Tests can be performed with phantom. You must configure it in the ReSharper options. Phantom may be needed for the CI build server. You can find some useful configurations here .

0
source

Source: https://habr.com/ru/post/1213816/


All Articles