Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run tests of empty project with plain karma -> integration with JetBrains's IntelliJ is broken #12108

Closed
alexeagle opened this issue Sep 4, 2018 · 3 comments

Comments

@alexeagle
Copy link
Contributor

From @rcomblen on May 4, 2018 12:18

Bug Report or Feature Request (mark with an x)

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

Area

- [ x] devkit
- [ ] schematics

Versions

~$ node --version
v8.11.1
~$ npm --version
5.6.0
~$

Repro steps

  • Create an empty project using ng new myproject
  • Open the project in Intellij (2018.1.2 Ultimate)
  • Launch the unit tests using Karma plugin (181.4668.7)

The log given by the failure

/usr/bin/node /home/user/.IntelliJIdea2018.1/config/plugins/js-karma/js_reporter/karma-intellij/lib/intellijServer.js --karmaPackageDir=/home/user/sandbox/angular/myproject/node_modules/karma --configFile=/home/user/sandbox/angular/myproject/src/karma.conf.js

/home/user/sandbox/angular/myproject/node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma.ts:53
throw new Error(The '@angular-devkit/build-angular/plugins/karma' karma plugin is meant to +
^
Error: The '@angular-devkit/build-angular/plugins/karma' karma plugin is meant to be used from within Angular CLI and will not work correctly outside of it.
at init (/home/user/sandbox/angular/myproject/node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma.ts:53:11)

Desired functionality

karma start --config=karma.conf.js should just work.

Mention any other details that might be useful

Copied from original issue: angular/devkit#846

@alexeagle
Copy link
Contributor Author

From @UnitedPE on May 24, 2018 11:44

see #10703

@AlexGS74 presents a working solution

It works if you create a new run configuration. It will detect Cli and use it as Karma engine. If you run an old configuration still pointing to a global/local karma instance, it fails.

@filipesilva
Copy link
Contributor

This is intended behavior has indicated by the error message:

Error: The '@angular-devkit/build-angular/plugins/karma' karma plugin is meant to be used from within Angular CLI and will not work correctly outside of it.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants