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

Commit e7a4a1e

Browse files
committed
Feedback from @btford
1 parent 393e4ce commit e7a4a1e

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

docs/content/guide/unit-testing.ngdoc

+16-15
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ Notice that no global variables were harmed in the writing of this test.
180180
Angular comes with {@link di dependency injection} built-in, making the right thing
181181
easy to do, but you still need to do it if you wish to take advantage of the testability story.
182182

183-
## Additional libraries for testing Angular applications
183+
## Additional tools for testing Angular applications
184184

185-
For testing Angular applications there are libraries that you should use that will make testing much
185+
For testing Angular applications there are certain tools that you should use that will make testing much
186186
easier to set up and run.
187187

188188
### Karma
@@ -198,7 +198,7 @@ are available on [the Karma website](http://karma-runner.github.io/0.12/intro/in
198198

199199
### Jasmine
200200

201-
[Jasmine](http://jasmine.github.io/2.0/introduction.html) is a test driven development framework for
201+
[Jasmine](http://jasmine.github.io/1.3/introduction.html) is a test driven development framework for
202202
JavaScript that has become the most popular choice for testing Angular applications. Jasmine
203203
provides functions to help with structuring your tests and also making assertions. As your tests
204204
grow, keeping them well structured and documented is vital, and Jasmine helps achieve this.
@@ -214,20 +214,21 @@ describe("sorting the list of users", function() {
214214
And then each individual test is defined within a call to the `it` function:
215215

216216
```js
217-
describe("sorting the list of users", function() {
218-
it("sorts in descending order by default", function() {
217+
describe('sorting the list of users', function() {
218+
it('sorts in descending order by default', function() {
219219
// your test assertion goes here
220220
});
221221
});
222222
```
223223

224-
By grouping related tests within `describe` blocks, and describing each individual test within an
225-
`it` call, this keeps your tests self documented. Finally, Jasmine provides matchers which let you
226-
make assertions:
224+
Grouping related tests within `describe` blocks and describing each individual test within an
225+
`it` call keeps your tests self documenting.
226+
227+
Finally, Jasmine provides matchers which let you make assertions:
227228

228229
```js
229-
describe("sorting the list of users", function() {
230-
it("sorts in descending order by default", function() {
230+
describe('sorting the list of users', function() {
231+
it('sorts in descending order by default', function() {
231232
var users = ['jack', 'igor', 'jeff'];
232233
var sorted = sortUsers(users);
233234
expect(sorted).toEqual(['jeff', 'jack', 'igor']);
@@ -236,8 +237,9 @@ describe("sorting the list of users", function() {
236237
```
237238

238239
Jasmine comes with a number of matchers that help you make a variety of assertions. You should [read
239-
the Jasmine documentation](http://jasmine.github.io/2.0/introduction.html#section-Matchers) to see
240-
what they are.
240+
the Jasmine documentation](http://jasmine.github.io/1.3/introduction.html#section-Matchers) to see
241+
what they are. To use Jasmine with Karma, we use the
242+
[karma-jasmine](https://github.com/karma-runner/karma-jasmine) test runner.
241243

242244
### angular-mocks
243245

@@ -254,8 +256,7 @@ look at how we might test the controller below, which provides `$scope.grade`, w
254256
on the scope based on the length of the password.
255257

256258
```js
257-
angular
258-
.module('app')
259+
angular.module('app', [])
259260
.controller('PasswordController', function PasswordController($scope) {
260261
$scope.password = '';
261262
$scope.grade = function() {
@@ -380,7 +381,7 @@ The duplication is now gone, and encapsulated within the `beforeEach`. Each indi
380381
contains the code specific to that test, and not code that is general across all tests. As you
381382
expand your tests, keep an eye out for locations where you can use `beforeEach` to tidy up tests.
382383
`beforeEach` isn't the only function of this sort that Jasmine provides, and the [documentation
383-
lists the others](http://jasmine.github.io/2.0/introduction.html#section-Setup_and_Teardown).
384+
lists the others](http://jasmine.github.io/1.3/introduction.html#section-Setup_and_Teardown).
384385

385386
## Testing Filters
386387
{@link ng.$filterProvider Filters} are functions which transform the data into a user readable

0 commit comments

Comments
 (0)