According to this question, the way to get Resharper's test runner to recognize script dependencies in your jasmine test scripts is to include them in a doc comment, like so:
// 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');
});
});
That's great, but I'm writing my jasmine tests in TypeScript, with a test that looks kinda like so:
///<reference path="../../../Scripts/typings/jasmine/jasmine.d.ts"/>
///<reference path="../../../Scripts/typings/sinon/sinon.d.ts"/>
///<reference path="../../../Scripts/Payboard/Models.ts"/>
///<reference path="../EventReferences.ts"/>
describe('Payboard.Events', () => {
var server: SinonFakeServer;
beforeEach(() => {
Payboard.Events.setApiKey('apikey');
server = sinon.fakeServer.create();
});
afterEach(() => {
server.restore();
});
describe('#getAbsoluteUrl', () => {
it('should prepend app.payboard.com to the relative url', () => {
var absoluteUrl = Payboard.Events.getAbsoluteUrl('/some/random/url');
expect(absoluteUrl).toEqual('//app.payboard.com/some/random/url');
});
});
and when I include references like ///<reference path="~/Scripts/sinon-1.9.0.js"/>
, I get a TS compile message:
Incorrect reference. Only files with a .ts extension are allowed.
In other words, TS doesn't let me include .js files in doc comment reference tags.
Any suggestions for a workaround?