Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you reference external libraries with Jasmine + Resharper

I can run Jasmine unit tests from the Resharper 8.0 unit test runner. I have a problem where any Javascript references that are normally in the html page (ie in my case Ext-Js) then I can't use the Resharper test runner, as you don't seem to have access to the HTML page that Resharper uses. (I assume it's generated as I could not locate it on disk)

I was thinking if there is a way to call or load your external library references from the Javascript test file directly instead of via the html page, then I could get this to work. I've not found if that is possible with Javascript (or Ext-Js) yet.

like image 649
Stephen Price Avatar asked Jul 26 '13 01:07

Stephen Price


1 Answers

It seems the way to go at the moment is hardcoding include statements as special comments in the suite file (called doc-comments references), e.g.:

// include external files like so:
/// <reference path="/path/to/external-file.js" />

// than write your testing suite as usual:
describe('a silly suite', function() {
    it('should test something is happening', function() {
        expect(something).toBe('happening');
    });
});

See this thread on the ReSharper community, as the source of this recommendation.

like image 53
Eliran Malka Avatar answered Oct 06 '22 22:10

Eliran Malka