Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

State of Jasmine Unit Test support of Resharper 2017: Debug mode and AMD modules supported?

I currently use Chutzpah to run and debug Jasmine Unit tests that include AMD/require.js modules. I would like switch to the test runner of Resharper 2017. However, Resharper does not seem to fully support Jasmine Unit Tests?

A. Example jasmine test:

/// <reference path="../../bower_components/requirejs/require.js" />
/// <reference path="../../bower_components/jasmine-core/lib/jasmine-core/jasmine.js" />

describe('dummy example test', function() {
  it("should return bar", function () {
    expect(true).toEqual(true);
  });
});

The Test can be run with Resharper but the Debugging option is disabled: enter image description here

B. Example test with module definition:

/// <reference path="../../bower_components/requirejs/require.js" />
/// <reference path="../../bower_components/jasmine-core/lib/jasmine-core/jasmine.js" />

define(['Squire'], function(squire) {

  describe('dummy example test', function() {
    it("should return bar", function() {
      expect(true).toEqual(true);
      alert('has been executed');
    });
  });

});

If I start that with Resharper the test never ends and the it method is not called.

Is it true that Resharper 2016 does not yet support the Debugging of Jasmine unit tests and neither the usage of AMD modules with unit tests? Or do I need to somehow adapt my Resharper settings to get Debugging and AMD/requirejs modules to work?

Here are my current settings: enter image description here

(Since both Chutzpah and Resharper 10 use outdated versions of Jasmine I am also open for further suggestions that integrate well with VisualStudio.)

Edit: Resharper 2016 seems to support Jasmine Versions > 2.0.

Related (not up to date?) articles:

  • https://youtrack.jetbrains.com/issue/RSRP-427836

  • https://devnet.jetbrains.com/message/5528577

  • http://www.neovolve.com/2015/01/30/resharper-jasmine-and-requirejs/

  • Jasmine and Requirejs in Resharper 7

  • How to test spa js modules with resharper testr jasmin?

  • Front end javascript testing using Require and Resharper

  • How do you debug Jasmine tests with Resharper?

  • Jasmine tests in Resharper don't stop executing

Edit

The questions have been originally posted for Resharper 10. They are still valid for Resharper 2016.

like image 656
Stefan Avatar asked Nov 09 '22 01:11

Stefan


1 Answers

As of ReSharper 2016.1:

A. Debugging JavaScript tests is not supported. Here is the feature request.

B. AMD is not supported. Here is the related ticket.

like image 155
Dmitry Matveev Avatar answered Nov 15 '22 12:11

Dmitry Matveev