Skip to content

Commit

Permalink
Styling tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Feb 3, 2018
1 parent 890eef1 commit 2a809e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

This module allows to convert
[`Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)
stream into its promisified version, which returns [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
object fulfilled when
[`open`](https://nodejs.org/api/fs.html#fs_event_open),
stream into its promisified version, which returns
[`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
object fulfilled when [`open`](https://nodejs.org/api/fs.html#fs_event_open),
[`data`](https://nodejs.org/api/stream.html#stream_event_data),
[`close`](https://nodejs.org/api/fs.html#fs_event_close),
[`end`](https://nodejs.org/api/stream.html#stream_event_end) or
Expand Down Expand Up @@ -133,7 +133,7 @@ await promiseReadable.once('close')
promiseReadable.stream.on('data', (chunk) => console.log(chunk.length))
await promiseReadable.once('end')

await promiseReadable.once('error') // undefined if already ended or throws error
await promiseReadable.once('error') // throws error, undefined if ended
```

#### destroy
Expand Down
4 changes: 2 additions & 2 deletions test/promise-readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MockStream extends EventEmitter {
_append (chunk) {
this._buffer = Buffer.concat([this._buffer, chunk])
}
_throw (e) {
_setError (e) {
this._error = e
}
}
Expand Down Expand Up @@ -211,7 +211,7 @@ Feature('Test promise-readable module with stream2 API', () => {
})

When('stream will emit an error event', () => {
stream._throw(new Error('boom'))
stream._setError(new Error('boom'))
})

And('I call read method', () => {
Expand Down

0 comments on commit 2a809e7

Please sign in to comment.