Angular-cli: Allow generation of apps with nested e2e projects instead of sibling e2e projects.

Created on 20 Sep 2018  路  3Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

This is a feature request

Desired functionality


When generating a new app inside of a workspace, I would like to be able to nest the respective e2e project inside the new app.

Current structure: sibling e2e (ng generate application app2)

...
projects
    -app2
        -src
    -app2-e2e

Desired structure: nested e2e

...
projects
    -app2
        -src
        -e2e

Mention any other details that might be useful


Initially raised this as a feature request / PR in Nrwl's NX repo here: https://github.com/nrwl/nx/issues/743
But it was determined that this is the appropriate place to raise this feature request.

Related question on SO here: https://stackoverflow.com/questions/51763075/why-does-nrwl-nx-create-a-separate-e2e-project-for-each-app/

Proposal

Add a new option to the ng generate application schematic named nestE2e (although naming things isn't exactly my specialty), which can be used to create a nested e2e project (as opposed to a sibling e2e project) for the newly generated app.

ng generate application my-app --nestE2e

Consideration

This would be helpful for working in a monorepo, or for working in an empty workspace (#12216). As more apps get generated, you wouldn't be left with 2x the number of folders cluttering (imo) the projects directory.

The desired structure above is also more familiar to people who work on standalone apps generated with ng new, in that e2e code is kept within the app directory.

schematicangular feature

Most helpful comment

This will be the default behavior in 8.0.

All 3 comments

This will be the default behavior in 8.0.

This isn't the default behavior for creating an app with cypress though is it? Just upgraded to nx8 and it still creates cypress e2e folders alongside the app folder. Not sure this is entirely "closed" @hansl

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brtnshrdr picture brtnshrdr  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments

hartjo picture hartjo  路  3Comments

sysmat picture sysmat  路  3Comments