In my VS2017 project, I have a Jasmine test written in TypeScript:
describe("A simple test", () => {
it("Should succeed", () => {
expect(true).toBeTruthy();
});
});
Everything runs smoothly using the ReSharper test runner.
However, when I include
import { TestedObject } from "./TestedModule";
at the beginning of the file and try to run the test again, ReSharper displays:
Ignored: Task skipped on timeout
Jasmine shows:
No specs found
and checking the browser console reveals:
Uncaught ReferenceError: define is not defined
Upon investigating further, it appears that the transpiled TypeScript is expecting RequireJS AMD module loading, as set up in tsconfig.json:
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var TestedObject = (function () {
function TestedObject() {
this.magicNumber = 3;
}
return TestedObject;
}());
exports.TestedObject = TestedObject;
});
Unfortunately, RequireJS is not loaded, and I am unsure how to make it available for the tests. Any guidance on either integrating RequireJS or setting up an alternative configuration to ensure ReSharper can still run the tests would be greatly appreciated.