You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But this creates weird folder structure inside build, understandable because it considers project root as source root which is not the same thing at all. Now, from what I've tried, the ideal situation would be to have multiple source directories that output in the same build dir. In this way, the tests would be able to avoid having to declare the horor that is /// reference.
I could use different tsconfig.json for sources and test directories, but then how do you specify the tests that references can be found additionally in another directory too.
What do you recommend, what can be done ?
The text was updated successfully, but these errors were encountered:
In every source directory create a directory called __tests__ where you keep your unit tests? This approach is used by test runners like jest.
You can then import the units under test using relative paths and it has the advantage that your tests are very visible and easy to find, but don't clutter up the source directories.
I need to have the following structure:
My goal is that in the tests I want to be able to import the associated tested class without using
/// reference
.This would work out of the box if the test would stay right next to the class, not in separate directories:
But it is extremly ugly and dirty and it gets even more so when these folders start growing(hundreds of classes, hundreds of tests ...)
My second attempt was to use a
tsconfig.json
:But this creates weird folder structure inside build, understandable because it considers project root as source root which is not the same thing at all. Now, from what I've tried, the ideal situation would be to have multiple source directories that output in the same build dir. In this way, the tests would be able to avoid having to declare the horor that is
/// reference
.I could use different
tsconfig.json
for sources and test directories, but then how do you specify the tests that references can be found additionally in another directory too.What do you recommend, what can be done ?
The text was updated successfully, but these errors were encountered: