-
Куда класть тесты то? FSD это регламентирует?
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
TL;DR: Put them in segments next to the code that they are testing. There are no restrictions in FSD as to where you can place your tests. The two common configurations are
From the point of view of FSD, the first approach is more preferable, since one of the main benefits of FSD is low coupling, so that changes to one aspect of the project happen in one small subfolder, not one file per folder across all folders. This can be achieved by placing your tests in a For example:
Any setup code for tests or global mocks can be placed in its own segment in Shared, |
Beta Was this translation helpful? Give feedback.
TL;DR: Put them in segments next to the code that they are testing.
There are no restrictions in FSD as to where you can place your tests. The two common configurations are
src
and only contains testsFrom the point of view of FSD, the first approach is more preferable, since one of the main benefits of FSD is low coupling, so that changes to one aspect of the project happen in one small subfolder, not one file per folder across all folders. This can be achieved by placing your tests in a
spec`` or
tests/` folder inside each segment. Mocks can be stored in that folder as well.F…