Angular-cli: Add Jest and Puppeteer as two new options to Angular-CLI

Created on 22 Jun 2018  路  8Comments  路  Source: angular/angular-cli

- [ ] bug report -> please search issues before submitting
- [x] feature request

Area

- [x] devkit
- [x] schematics

Versions

Angular CLI: 6.0.8
Node: 10.1.0
OS: Win 10

Desired functionality

Make unit testing possible with Jest instead of Jasmine.
Make E2E testing possible with Puppeteer instead of Protractor.

Mention any other details that might be useful

for now no way to doing this. Jest Puppeteer and jest-preset-angular have two different and unmergeable presets so we can not use them together. I think Angular-CLI team can do this as an option for Angular world.

Please make this happen.

feature

Most helpful comment

Just a heads up that the new Vue CLI 3.0.0 has configurable options for unit and e2e testing, much like you propose:

In addition, there are many optional integrations that you can mix and match when you create a new project, such as:

  • [...]
  • Unit Testing via Jest or Mocha
  • E2E Testing via Cypress or Nightwatch

https://medium.com/the-vue-point/vue-cli-3-0-is-here-c42bebe28fbb

It would be nice if Angular Cli would support alternatives as well. Personally, I prefer e2e testing with Cypress or Testcafe instead of Puppeteer. So maybe add multiple options in the cli?

All 8 comments

Yes, please!

Just a heads up that the new Vue CLI 3.0.0 has configurable options for unit and e2e testing, much like you propose:

In addition, there are many optional integrations that you can mix and match when you create a new project, such as:

  • [...]
  • Unit Testing via Jest or Mocha
  • E2E Testing via Cypress or Nightwatch

https://medium.com/the-vue-point/vue-cli-3-0-is-here-c42bebe28fbb

It would be nice if Angular Cli would support alternatives as well. Personally, I prefer e2e testing with Cypress or Testcafe instead of Puppeteer. So maybe add multiple options in the cli?

I think this could start with Jest first, and after that adds the others. Having first class support to Jest from Angular team would be huge for the usage of that Framework.

You can use jest with nrwl/nx. I am interested in knowing how to swap out protractor with puppeteer for e2e.

Closing this as this is not currently in the CLI roadmap and as mentioned above there are already other alternatives.

You can use jest with nrwl/nx. I am interested in knowing how to swap out protractor with puppeteer for e2e.

This is a request to get support for Jest in Angular CLI, I don't see what it has to do with nrwl/nx.

Closing this as this is not currently in the CLI roadmap and as mentioned above there are already other alternatives.

What do you mean by alternatives?

What do you mean by alternatives?

By alternatives, he means that though it's not officially supported, it have tools that allow the integration _kind of_.

https://github.com/meltedspark/angular-builders/tree/master/packages/jest

However, I would like to mention that currently there is no way to override the Angular CLI file generator per file basis. So, you have to manually rewrite the test for then to fit better with Jest.

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