What should be the top level folders split for tests in JavaScript/TypeScript?
E.g. if my application has the following logical modules: AdminPanel
, Profile
, ProductsListPage
. And I have the following Mocha type tests: e2e
, smoke
, integration
, unit
.
Should my folder sctructure be:
AdmintPanel:
e2e
smoke
integration
unit
Profile:
e2e
smoke
integration
unit
ProductsListPage:
...
Or is it better to have the following folders structure:
e2e:
AdminPanel
Profile
ProductsListPage
smoke:
AdminPanel
Profile
ProductsListPage
integration:
...
unit:
...
My guts tell me that splitting by test types first is better, but I lack any constructive arguments to support my point of view. So, I can not persuade my colleagues to follow the test types first
approach. I tried to google best practices on the matter but did not succeed finding anything. So, hopefully someone on SO know the best practices in this respect.