Skip to content

karma-chai-plugins missing from package.json => failing gulp test:client #2219

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

Closed
1 task done
erikrenberg opened this issue Sep 9, 2016 · 2 comments
Closed
1 task done
Assignees
Labels

Comments

@erikrenberg
Copy link
Contributor

  • I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Item Version
generator-angular-fullstack 4.0.4
Node 6.5.0
npm 3.10.7

Windows 10
Client Tests

I generated a fresh app with "mocha": false and I noticed that gulp test:client fails because of a missing npm package:

{ Error: Cannot find module 'karma-chai-plugins'

And indeed that file is required by the generated karma.conf.js, but is not included in the likewise generated package.json.

The template file for package.json seems to only include that package if mocha is enabled, which again I didn't select when running the generator.

So either I made some strange combination of choices :), or karma-chai-plugins should be added by the generator not just when mocha is selected?

PS. I also noticed that two require('karma-chai-plugins') seems to be added by the generator if "mocha":true. See lines 50 and 56 in templates/app/karma.conf.js. This doesn't seem right either. DS.

Here is a potentially relevant part of my .yo-rc.json:

    "jasmine": true,
      "mocha": false,
      "should": false,
      "expect": false
@Awk34
Copy link
Member

Awk34 commented Sep 12, 2016

The require should be excluded if you use Jasmine for the front-end tests

@Awk34 Awk34 added the bug label Sep 12, 2016
@erikrenberg
Copy link
Contributor Author

Thanks, right you are (I guess my issue subject was a bit misleading).

(Simply removing the first require of karma-chai-plugins (on line 50) in templates/app/karma.conf.js probably fixes the issue with the generator, since it is included for mocha on line 56 anyway).

@Awk34 Awk34 self-assigned this Sep 12, 2016
@Awk34 Awk34 closed this as completed in c188229 Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants