Skip to content

Commit

Permalink
Improve readme semantics.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanve committed Nov 4, 2013
1 parent 7dff463 commit ce79ff0
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@


## API ([1.7](../../releases)) ## API ([1.7](../../releases))


### `aok(testObject)` ### aok(testObject)


#### `testObject` properties #### <var>testObject</var> properties


- **id**: identifier or name for the test (defaults to a positive integer) - **id**: identifier or name for the test (defaults to a positive integer)
- **test**: result or callback (called in `testObject`'s scope) - **test**: result or callback (called in <var>testObject</var>'s scope)
- **pass**: message or callback (default: "Pass") - **pass**: message or callback (default: "Pass")
- **fail**: message or callback (default: "Fail") - **fail**: message or callback (default: "Fail")
- **handler**: defaults to `aok.prototype.handler` - **handler**: defaults to `aok.prototype.handler`
Expand All @@ -19,7 +19,9 @@
- **cull**: defaults to `aok.prototype.cull` - **cull**: defaults to `aok.prototype.cull`
- **init**: defaults to `aok.prototype.init` - **init**: defaults to `aok.prototype.init`


#### syntax #### Syntax

##### Objects


```js ```js
aok({ aok({
Expand All @@ -42,7 +44,7 @@ aok(function() {
}); });
``` ```


### console methods ### Console methods


- `aok.log(message)` - `aok.log(message)`
- `aok.info(message)` - `aok.info(message)`
Expand All @@ -52,15 +54,15 @@ aok(function() {
- `aok.trace()` - `aok.trace()`
- `aok.clear()` <b>1.7+</b> - `aok.clear()` <b>1.7+</b>


### utilities ### Utilities


- `aok.can(fn)` Get a new function that uses `try`/`catch` to test if `fn` can run. - `aok.can(fn)` Get a new function that uses `try`/`catch` to test if <var>fn</var> can run.
- `aok.pass(stack, test, scope?, limit?)` Iterate `stack` to count <b>passes</b> until `limit`. - `aok.explain(item?)` Represent <var>item</var> (or self) as a string.
- `aok.fail(stack, test, scope?, limit?)` Iterate `stack` to count <b>fails</b> until `limit`. - `aok.perform(trials, fn)` Test how many milliseconds it takes for <var>fn</var> to run <var>trials</var> times.
- `aok.race(trials, rivals)` Test how long it takes each rival to run `trials` times. - `aok.race(trials, rivals)` Test how many milliseconds it takes each rival to run <var>trials</var> times.
- `aok.perform(trials, fn)` Test how long it takes for `fn` to run `trials` times. - `aok.pass(stack, test, scope?, limit?)` Iterate <var>stack</var> to count <b>passes</b> until <var>limit</var>.
- `aok.explain(item?)` Represent `item` (or `this`) as a string. - `aok.fail(stack, test, scope?, limit?)` Iterate <var>stack</var> to count <b>fails</b> until `limit`.
- `aok.result(object, key|fn)` Call `object[key]` or `fn.call(object)` if callable. - `aok.result(object, key|fn)` Get `object[key]` or its method's result if callable.


## License: [MIT](http://en.wikipedia.org/wiki/MIT_License) ## License: [MIT](http://en.wikipedia.org/wiki/MIT_License)


Expand Down

0 comments on commit ce79ff0

Please sign in to comment.