Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit 16085c1

Browse files
JosephPecorarogsnedders
authored andcommitted
Fix API documentation (#237)
- invalid code examples - clean up trailing punctuation
1 parent 0e55dca commit 16085c1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/api.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ The properties argument is identical to that for `test()`.
118118

119119
In many cases it is convenient to run a step in response to an event or a
120120
callback. A convenient method of doing this is through the `step_func` method
121-
which returns a function that, when called runs a test step. For example
121+
which returns a function that, when called runs a test step. For example:
122122

123123
```js
124124
document.addEventListener("DOMContentLoaded", t.step_func(function() {
125125
assert_true(e.bubbles, "bubbles should be true");
126126
t.done();
127-
});
127+
}));
128128
```
129129

130130
As a further convenience, the `step_func` that calls `done()` can instead
@@ -133,7 +133,7 @@ use `step_func_done`, as follows:
133133
```js
134134
document.addEventListener("DOMContentLoaded", t.step_func_done(function() {
135135
assert_true(e.bubbles, "bubbles should be true");
136-
});
136+
}));
137137
```
138138

139139
For asynchronous callbacks that should never execute, `unreached_func` can
@@ -276,7 +276,7 @@ The test title for single page tests is always taken from `document.title`.
276276

277277
Functions for making assertions start `assert_`. The full list of
278278
asserts avaliable is documented in the [asserts](#list-of-assertions) section
279-
below. The general signature is
279+
below. The general signature is:
280280

281281
```js
282282
assert_something(actual, expected, description)
@@ -286,7 +286,7 @@ although not all assertions precisely match this pattern e.g. `assert_true`
286286
only takes `actual` and `description` as arguments.
287287

288288
The description parameter is used to present more useful error messages when
289-
a test fails
289+
a test fails.
290290

291291
NOTE: All asserts must be located in a `test()` or a step of an
292292
`async_test()`, unless the test is a single page test. Asserts outside
@@ -300,7 +300,7 @@ In order to ensure that tests are independent, such state should be cleaned
300300
up once the test has a result. This can be achieved by adding cleanup
301301
callbacks to the test. Such callbacks are registered using the `add_cleanup`
302302
function on the test object. All registered callbacks will be run as soon as
303-
the test result is known. For example
303+
the test result is known. For example:
304304

305305
```js
306306
test(function() {

0 commit comments

Comments
 (0)