nestjs / schematics

Nest architecture element generation based on Angular schematics 🎬

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When converting project to a monorepo configure all E2E tests to be run

MitchellCash opened this issue · comments

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

When converting a project to a monorepo npm run test:e2e only runs the initial projects E2E tests.

Describe the solution you'd like

Let's say you have a Nest project called my-app and then inside my-app I run nest generate app my-other-app.

Inside the package.json we would have the test:e2e run command below:

"test:e2e": "jest --config ./apps/my-app/test/jest-e2e.json"

I would propose a possible solution that would look like:

"test:e2e": "jest --projects ./apps/my-app/test/jest-e2e.json ./apps/my-other-app/test/jest-e2e.json"

Note that instead of using the --config option I am instead using the --projects option to specify multiple E2E configuration files.

Teachability, documentation, adoption, migration strategy

This in theory is not a breaking change, nor requires any additional documentation.

What is the motivation / use case for changing the behavior?

I am just starting to convert a project to a monorepo and I found that the npm run test command would run all the tests across all apps, but the npm run test:e2e command would only run from the initial app. I thought it would make sense for them both to run all tests available in the project, not just from one app.

Would you like to create a PR for this issue?