Skip to content

Commit b445a2b

Browse files
committed
[readme] hard wraps bad, soft wraps good
1 parent 459a1c5 commit b445a2b

File tree

1 file changed

+14
-27
lines changed

1 file changed

+14
-27
lines changed

readme.markdown

+14-27
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ not ok 2 should be strictly equal
5555

5656
# usage
5757

58-
You always need to `require('tape')` in test files. You can run the tests by
59-
usual node means (`require('test-file.js')` or `node test-file.js`). You can
60-
also run tests using the `tape` binary to utilize globbing, on Windows for
61-
example:
58+
You always need to `require('tape')` in test files. You can run the tests by usual node means (`require('test-file.js')` or `node test-file.js`).
59+
You can also run tests using the `tape` binary to utilize globbing, on Windows for example:
6260

6361
```sh
6462
$ tape tests/**/*.js
@@ -102,8 +100,7 @@ Please note that all modules loaded using the `-r` flag will run *before* any te
102100

103101
The default TAP output is good for machines and humans that are robots.
104102

105-
If you want a more colorful / pretty output there are lots of modules on npm
106-
that will output something pretty if you pipe TAP into them:
103+
If you want a more colorful / pretty output there are lots of modules on npm that will output something pretty if you pipe TAP into them:
107104

108105
- [tap-spec](https://github.com/scottcorgan/tap-spec)
109106
- [tap-dot](https://github.com/scottcorgan/tap-dot)
@@ -131,8 +128,7 @@ that will output something pretty if you pipe TAP into them:
131128
- [tape-repeater](https://github.com/rgruesbeck/tape-repeater)
132129
- [tabe](https://github.com/Josenzo/tabe)
133130

134-
To use them, try `node test/index.js | tap-spec` or pipe it into one
135-
of the modules of your choice!
131+
To use them, try `node test/index.js | tap-spec` or pipe it into one of the modules of your choice!
136132

137133
## uncaught exceptions
138134

@@ -150,8 +146,7 @@ By default, uncaught exceptions in your tests will not be intercepted, and will
150146

151147
# methods
152148

153-
The assertion methods in `tape` are heavily influenced or copied from the methods
154-
in [node-tap](https://github.com/isaacs/node-tap).
149+
The assertion methods in `tape` are heavily influenced or copied from the methods in [node-tap](https://github.com/isaacs/node-tap).
155150

156151
```js
157152
var test = require('tape')
@@ -160,8 +155,8 @@ var test = require('tape')
160155
## test([name], [opts], cb)
161156

162157
Create a new test with an optional `name` string and optional `opts` object.
163-
`cb(t)` fires with the new test object `t` once all preceding tests have
164-
finished. Tests execute serially.
158+
`cb(t)` fires with the new test object `t` once all preceding tests have finished.
159+
Tests execute serially.
165160

166161
Available `opts` options are:
167162
- opts.skip = true/false. See test.skip.
@@ -191,9 +186,8 @@ The onFailure hook will get invoked whenever any `tape` tests has failed.
191186

192187
## t.plan(n)
193188

194-
Declare that `n` assertions should be run. `t.end()` will be called
195-
automatically after the `n`th assertion. If there are any more assertions after
196-
the `n`th, or after `t.end()` is called, they will generate errors.
189+
Declare that `n` assertions should be run. `t.end()` will be called automatically after the `n`th assertion.
190+
If there are any more assertions after the `n`th, or after `t.end()` is called, they will generate errors.
197191

198192
## t.end(err)
199193

@@ -265,33 +259,25 @@ Aliases: `t.notLooseEquals()`
265259

266260
## t.deepEqual(actual, expected, msg)
267261

268-
Assert that `actual` and `expected` have the same structure and nested values using
269-
[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal)
270-
with strict comparisons (`===`) on leaf nodes and an optional description of the assertion `msg`.
262+
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 of the assertion `msg`.
271263

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

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

276-
Assert that `actual` and `expected` do not have the same structure and nested values using
277-
[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal)
278-
with strict comparisons (`===`) on leaf nodes and an optional description of the assertion `msg`.
268+
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 of the assertion `msg`.
279269

280270
Aliases: `t.notDeepEquals`, `t.notEquivalent()`, `t.notDeeply()`, `t.notSame()`,
281271
`t.isNotDeepEqual()`, `t.isNotDeeply()`, `t.isNotEquivalent()`,
282272
`t.isInequivalent()`
283273

284274
## t.deepLooseEqual(actual, expected, msg)
285275

286-
Assert that `actual` and `expected` have the same structure and nested values using
287-
[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal)
288-
with loose comparisons (`==`) on leaf nodes and an optional description of the assertion `msg`.
276+
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 of the assertion `msg`.
289277

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

292-
Assert that `actual` and `expected` do not have the same structure and nested values using
293-
[node's deepEqual() algorithm](https://github.com/substack/node-deep-equal)
294-
with loose comparisons (`==`) on leaf nodes and an optional description of the assertion `msg`.
280+
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 of the assertion `msg`.
295281

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

@@ -345,6 +331,7 @@ Please note that the second parameter, `expected`, cannot be of type `string`. I
345331
Assert that the function call `fn()` does not throw an exception. `expected`, if present, limits what should not be thrown, and must be a `RegExp` or `Function`. The `RegExp` matches the string representation of the exception, as generated by `err.toString()`. For example, if you set `expected` to `/user/`, the test will fail only if the string representation of the exception contains the word `user`. Any other exception will result in a passed test. The `Function` is the exception thrown (e.g. `Error`). If `expected` is not of type `RegExp` or `Function`, or omitted entirely, any exception will result in a failed test. `msg` is an optional description of the assertion.
346332

347333
Please note that the second parameter, `expected`, cannot be of type `string`. If a value of type `string` is provided for `expected`, then `t.doesNotThrows(fn, expected, msg)` will execute, but the value of `expected` will be set to `undefined`, and the specified string will be set as the value for the `msg` parameter (regardless of what _actually_ passed as the third parameter). This can cause unexpected results, so please be mindful.
334+
348335
## t.test(name, [opts], cb)
349336

350337
Create a subtest with a new test handle `st` from `cb(st)` inside the current test `t`. `cb(st)` will only fire when `t` finishes. Additional tests queued up after `t` will not be run until all subtests finish.

0 commit comments

Comments
 (0)