When creating a new nx workspace (i.e. with create-nx-workspace) and then generating an app (with ng g app) it creates an app folder inside the apps folder (so far so good) and also another app-e2e folder, also inside the apps folder. In my mind it would make much more sense to create an e2e folder inside the app folder, next to the src folder, since the e2e tests should belong to that specific app and also it won't clutter the apps folder that way.
So what is the reasoning behind this convention?
Thanks a lot!
It turns out that it's actually due to the Angular 6 CLI. Nx just uses the built in angular schematics. I wasn't aware of this initially, but you can verify this behavior by creating a new app with ng new app1
and then ng generate application app2
inside of app1. app1
is created with the regular structure, while app2
and a sibling app2-e2e
are created inside a default projects
directory within app1
.
Initially, I had the same question as you. I have been manually restructuring every newly generated app in my nx workspace so that the e2e folder is inside of its respective app folder. This led me to create a feature request in the nx repo. The underlying Angular CLI 6 convention was explained to me after I opened a PR for this functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With