Reference JS file from TS file

Topics: General
Jul 16, 2013 at 6:07 PM
Edited Jul 16, 2013 at 6:10 PM
In order to write unit tests on TS I need to reference the testing (generated from TS) JS code using <reference path="xxx.js"> (this instruction is used by Resharper to load proper JS code that would be tested). But when compiling, the TS compiler says that it can't find the xxx.js file. I`ve tried to save it in unicode with no luck.
Is there a way to reference the JS file from TS file?
Coordinator
Jul 18, 2013 at 11:40 PM
Unfortunately, not. This is because ///reference has meaning to TypeScript that's different than what other tools are using it for. You might be able to work around this by using a different kind of comment, preserving the comment, and then using a second pass on the output .js to convert it back to the style you're looking for. That wouldn't fix editing the .ts from the IDE, so I'm not sure if it fixes your particular issue.