Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
This repository was archived by the owner on Jul 29, 2026. It is now read-only.

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

Closed

Description

@erikrenberg
  • 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

Activity

  1. Awk34 commented on Sep 12, 2016

    @Awk34
    Collaborator

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

  2. erikrenberg commented on Sep 12, 2016

    @erikrenberg
    ContributorAuthor

    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).

  3. self-assigned this
    on Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions