nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.62k stars 2.36k forks source link

Add a guide showing how to set up an Angular project with Karma and Protractor #1903

Closed vsavkin closed 3 years ago

vsavkin commented 5 years ago

We default to Jest and Cypress when create an Angular project. And we don't give an option to use Karma when folk using presets.

To create a project with karma, you need to do something like this:

npx create-nx-workspace myorg --preset=empty --cli=angular
ng add @nrwl/angular
ng g app myapp --unit-test-runner=karma

We should document it

juristr commented 5 years ago

@vsavkin If you want I can take this one. Could take a look at this next week, at max in 2 weeks. So I get to know a bit better the docs part of this repo as well. let me know

maartentibau commented 4 years ago

I actually have a small "guide" for it.

npx create-nx-workspace@latest {workspace-name}

npx ng config cli.packageManager npm

npx ng add @nrwl/angular@latest --registry=npm --interactive=true

npx ng g @nrwl/angular:application {application-name} --routing=true --style=scss --e2e-test-runner=protractor

npx ng config schematics.@schematics/angular:component.styleext scss

I personally was not aware you could also do this with --unit-test-runner=karma

FrozenPandaz commented 4 years ago

Hi, sorry about this.

This was mislabeled as stale. We are testing ways to mark not reproducible issues as stale so that we can focus on actionable items but our initial experiment was too broad and unintentionally labeled this issue as stale.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

Blackbaud-SteveBrush commented 2 years ago

The above comments weren't working for me, but this got me to my desired state (Angular CLI, Karma, NPM):

npx create-nx-workspace --cli=angular --defaultBase=main --name=my-monorepo --nxCloud --packageManager=npm --preset=empty

cd my-monorepo

npx ng add @nrwl/angular --skip-confirmation --style=scss --unitTestRunner=karma

npx nx generate @nrwl/angular:application --name=my-app --prefix=app --routing --strict --style=scss --unitTestRunner=karma
oletrn commented 1 year ago

Finally, I've managed to generate a project with Karma runner this way:

  1. npx create-nx-workspace --preset=empty --name=my-app
  2. cd my-app
  3. npm install @nrwl/angular
  4. nx generate @nrwl/angular:app foobar --style=scss --unitTestRunner=karma
github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.