This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Karma also needs to be told about ngResource #7575
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In step 11 the controllers' unit tests are adapted to work with the Phone service, which uses the ngResource module. But for this to work, Karma's configuration also needs to be told to load the
angular-resource.js
file through itskarma.conf.js
configuration, and any testing runs that may be happening at the time restarted for the change to take effect.Though the diff from step 10 to step 11 does modify the Karma configuration, angular/angular-phonecat@step-10...step-11, the explanation says nothing about it, and the tests will all fail precisely because of a failure to load ngResource for no apparent reason until the module is explicitly made available to Karma through the steps described in this pull request.
Feel free to adapt the wording to whatever may be more appropriate, but the extra instructions added in this pull request seem to be absolutely indispensable to get all tests in the green again.
An alternative, of course, is to simply ship a
karma.conf.js
withangular-resource.js
already loaded in an updated source package, and sidestep this whole problem that arises in step 11 from the start.