I have a problem with tests written in typescript which reference other typescript classes (those under test) when the classes under test are in a different project.
for example I have a solution which contains Project A and Project A.Tests.
The solution has this structure:
A
-Scripts
--Class.ts
A.Tests
-Scripts
--ClassTests.ts
in ClassTests.ts I have this:
///<reference="../../A/Scripts/Class.ts"/>
This builds fine in vs as the relative paths are all fine.
However in NCrunch the build often fails as sometimes the workspace only contains the project A.Tests and not the source for A.
As Typescript files are compiled with an MSBuild step in the csproj this then causes the whole build to fail and NCRunch to not be able to run any of the tests (A.Tests also contains many SpecFlow tests).
this problem has only surfaced since I converted my JavaScript tests into TypeScript tests. I tried included a link to the whole A scripts folder but this only add them in VS and doesn't copy them on the disk.
Workarounds that I can think of are:
- Move the typescript tests into A
- Have a build step which copies the source from A to A.Tests (not really sure that this will work though)
but I wonder if there is a 'better' solution from an NCrunch point of view, or if you have any suggestions?
Can I some how force NCrunch to always build 2 projects in the same workspace?