Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Better error message if a dependency is not included in karma tests #3752

Closed
@csenger

Description

@csenger

generator-angular set's up karma tests which is great. If you depend on a module you have to add the source file to karma.conf.js:files to be available in tests. Without it you get something like:

Chrome 29.0 (Linux) Service: RestangularRouteProvider should do something FAILED
    Error: [$injector:modulerr] Failed to instantiate module gcmapApp due to:
    Error: [$injector:modulerr] Failed to instantiate module ngRoute due to:
    Error: [$injector:nomod] Module 'ngRoute' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
        at /srv/gc-map/client/app/bower_components/angular/angular.js:60:12

The error message doesn't give a hint where to add the dependencies to the js-file in tests. It would be good to help people that are new to angular and don't know where to look, even so it's an issue with the test runner. Maybe the error reference for $injector:nomod can be extended to give a hint for karma users:

http://docs.angularjs.org/error/$injector:nomod

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions