Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit d9986ee

Browse files
committed
chore: start stream flowing in test
1 parent 2d4c571 commit d9986ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/core/components/files-regular/get-readable-stream.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ const toStream = require('it-to-stream')
44

55
module.exports = function (self) {
66
return function getReadableStream (ipfsPath, options) {
7-
return toStream.readable((async function * () {
7+
return toStream.readable((async function * mapStreamFileContents () {
88
for await (const file of self._getAsyncIterator(ipfsPath, options)) {
99
if (file.content) {
1010
file.content = toStream.readable(file.content())
1111
}
1212

1313
yield file
1414
}
15-
}()), {
15+
})(), {
1616
objectMode: true
1717
})
1818
}

test/core/files.spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ describe('files', function () {
4949
const invalidPath = null
5050
const stream = ipfs.getReadableStream(invalidPath)
5151

52+
stream.on('data', () => {})
5253
stream.on('error', (err) => {
5354
expect(err).to.exist()
5455
expect(err.code).to.equal('ERR_INVALID_PATH')

0 commit comments

Comments
 (0)