This project is read-only.


Reference root path should be project


If you add a <reference path="/" /> to include all files in root folder, it appears like c: is scanned recursively?

The current visual studio project could be the root here, so the only needed reference is the line
<reference path="/_references.js" />
in all test files

Another useful feature could be configurable constants, for the case where you have your tests in one VS project, and the target in another.
Something like
<reference path="$TargetProject/viewmodels/myViewModel.js" />
A settings file could contain these settings and be included in the solution to share the settings in the team.
Closed Feb 23, 2013 at 11:39 PM by mmanela
Fixed in 2.3


mmanela wrote Jan 13, 2013 at 11:22 PM

I agree with the convenience of being able to give a common parent for reference paths. The difficulty is that Chutzpah runs in VS and out of VS so using the project file as the root is not a great option.

With the next Chutzpah release which I am pretty much done I am adding a settings file (chutzpah.json) and in a subsequent release I could add an option to make this the root of references when a reference starts with /.

What do you think of that or other options?

johano wrote Jan 14, 2013 at 8:43 AM

Yes the option with using the settings file could be useful if it's placed under project root.
The point is basicly to add support for easy refactoring in a large project, and also support tests in one vsproj with it's target files in another vsproj.

references (and even _references.js) at the moment is too complex to manage. (if you have 3000 tests and every test has reference targets using relative paths from their own folder to point at files in another project)

I was hoping you would see the benefit of having the configurable constants too.
But if the settings.json would be root, that would help to, if it supports /../myTargetProject/vm/viewmodel.js to point at another vs project?

johano wrote Jan 14, 2013 at 8:48 AM

Yes the settings.json would be useful, when placed under project root.
if I can use /../SomeVsProject/viewmodel.js to reference a script file in another visual studio project, that would cover the case with configurable constants too. It needs to be supported in both test files, and _references.js to cover all cases.

The point is basicly to add support for easy refactoring in a large project (1000+ tests) without using relative paths from the file containing the <reference> tag, and also support files in multiple projects.

Thank you.

mmanela wrote Jan 14, 2013 at 4:09 PM

I totally agree so here is a more detailed proposed solution.
You have a solution that looks like this:
       code.cs (and others)
        test.js (and others)
In the chutzpah.json file there would be a variable you can set named:
which by default is false but when set to true would cause a reference like:
<reference path="/" /> to reference the directory the chutzpah.json file is in.

This would not change the relative path behavior so a path like
<reference path = "../" /> is still relative to that test file itself.

Then in test.js you could write a reference path like:
<reference path="/src/code.js" />
and this would correctly reference the code.js file.

Am I missing anything? Would this solution work for you?

johano wrote Jan 14, 2013 at 10:23 PM

Sounds great. Just what we are looking for.
When can I expect this in a future release?
Thanks a bunch.

mmanela wrote Jan 16, 2013 at 3:56 PM

I checked in my proposed solution (with some slight setting parameter renaming). I will include this in my next release which I hope to wrap up this month.