Skip to content

Commit

Permalink
In docs, clarified when 'msg' describes the assertion. Also clarified…
Browse files Browse the repository at this point in the history
… 'expected' in throws().
  • Loading branch information
jtlapp committed Jul 17, 2016
1 parent fb600ee commit e532790
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ Generate an assertion that will be skipped over.

## t.ok(value, msg)

Assert that `value` is truthy with an optional description message `msg`.
Assert that `value` is truthy with an optional description of the assertion `msg`.

Aliases: `t.true()`, `t.assert()`

## t.notOk(value, msg)

Assert that `value` is falsy with an optional description message `msg`.
Assert that `value` is falsy with an optional description of the assertion `msg`.

Aliases: `t.false()`, `t.notok()`

Expand All @@ -209,14 +209,14 @@ Aliases: `t.ifError()`, `t.ifErr()`, `t.iferror()`

## t.equal(actual, expected, msg)

Assert that `actual === expected` with an optional description `msg`.
Assert that `actual === expected` with an optional description of the assertion `msg`.

Aliases: `t.equals()`, `t.isEqual()`, `t.is()`, `t.strictEqual()`,
`t.strictEquals()`

## t.notEqual(actual, expected, msg)

Assert that `actual !== expected` with an optional description `msg`.
Assert that `actual !== expected` with an optional description of the assertion `msg`.

Aliases: `t.notEquals()`, `t.notStrictEqual()`, `t.notStrictEquals()`,
`t.isNotEqual()`, `t.isNot()`, `t.not()`, `t.doesNotEqual()`, `t.isInequal()`
Expand All @@ -225,17 +225,15 @@ Aliases: `t.notEquals()`, `t.notStrictEqual()`, `t.notStrictEquals()`,

Assert that `actual` and `expected` have the same structure and nested values using
[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal)
with strict comparisons (`===`) on leaf nodes and an optional description
`msg`.
with strict comparisons (`===`) on leaf nodes and an optional description of the assertion `msg`.

Aliases: `t.deepEquals()`, `t.isEquivalent()`, `t.same()`

## t.notDeepEqual(actual, expected, msg)

Assert that `actual` and `expected` do not have the same structure and nested values using
[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal)
with strict comparisons (`===`) on leaf nodes and an optional description
`msg`.
with strict comparisons (`===`) on leaf nodes and an optional description of the assertion `msg`.

Aliases: `t.notEquivalent()`, `t.notDeeply()`, `t.notSame()`,
`t.isNotDeepEqual()`, `t.isNotDeeply()`, `t.isNotEquivalent()`,
Expand All @@ -245,25 +243,25 @@ Aliases: `t.notEquivalent()`, `t.notDeeply()`, `t.notSame()`,

Assert that `actual` and `expected` have the same structure and nested values using
[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal)
with loose comparisons (`==`) on leaf nodes and an optional description `msg`.
with loose comparisons (`==`) on leaf nodes and an optional description of the assertion `msg`.

Aliases: `t.looseEqual()`, `t.looseEquals()`

## t.notDeepLooseEqual(actual, expected, msg)

Assert that `actual` and `expected` do not have the same structure and nested values using
[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal)
with loose comparisons (`==`) on leaf nodes and an optional description `msg`.
with loose comparisons (`==`) on leaf nodes and an optional description of the assertion `msg`.

Aliases: `t.notLooseEqual()`, `t.notLooseEquals()`

## t.throws(fn, expected, msg)

Assert that the function call `fn()` throws an exception. `expected`, if present, must be a `RegExp` or `Function`.
Assert that the function call `fn()` throws an exception. `expected`, if present, must be a `RegExp` or `Function`. The `RegExp` matches the string representation of the exception, as generated by `err.toString()`. The `Function` is the exception thrown (e.g. `Error`). `msg` is an optional description of the assertion.

## t.doesNotThrow(fn, expected, msg)

Assert that the function call `fn()` does not throw an exception.
Assert that the function call `fn()` does not throw an exception. `msg` is an optional description of the assertion.

## t.test(name, [opts], cb)

Expand Down

0 comments on commit e532790

Please sign in to comment.