Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4547c11

Browse files
aschokkingcaitp
authored andcommitted
docs(tutorial): add karma config update reference to step 11
When including the ng-resource module you appear to need to add a reference to the karma config file as well or the unit tests will fail. This burned me for a while when going through the tutorial.
1 parent c0b360b commit 4547c11

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

docs/content/tutorial/step_11.ngdoc

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,22 @@ we require, so in these cases, we can add a callback to process the server respo
164164

165165
## Test
166166

167+
Because we're now using the {@link ngResource ngResource} module, it's necessary to also need to
168+
update the Karma config file with angular-resource so the new tests will pass.
169+
170+
__`test/karma.conf.js`:__
171+
172+
```js
173+
files : [
174+
'app/bower_components/angular/angular.js',
175+
'app/bower_components/angular-route/angular-route.js',
176+
'app/bower_components/angular-resource/angular-resource.js',
177+
'app/bower_components/angular-mocks/angular-mocks.js',
178+
'app/js/**/*.js',
179+
'test/unit/**/*.js'
180+
],
181+
```
182+
167183
We have modified our unit tests to verify that our new service is issuing HTTP requests and
168184
processing them as expected. The tests also check that our controllers are interacting with the
169185
service correctly.
@@ -175,7 +191,6 @@ solve the problem, we use a newly-defined `toEqualData` [Jasmine matcher][jasmin
175191
the `toEqualData` matcher compares two objects, it takes only object properties into account and
176192
ignores methods.
177193

178-
179194
__`test/unit/controllersSpec.js`:__
180195

181196
```js
@@ -191,7 +206,7 @@ describe('PhoneCat controllers', function() {
191206

192207
beforeEach(module('phonecatApp'));
193208
beforeEach(module('phonecatServices'));
194-
209+
```
195210

196211
describe('PhoneListCtrl', function(){
197212
var scope, ctrl, $httpBackend;

0 commit comments

Comments
 (0)