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

不打扰是莪最后的温柔 提交于 2019-11-28 01:16:05

问题


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:

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:

(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.


回答1:


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.



来源:https://stackoverflow.com/questions/33757264/state-of-jasmine-unit-test-support-of-resharper-2017-debug-mode-and-amd-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!