Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 546437a

Browse files
committed
Rebase + fix tests.
1 parent 09a1029 commit 546437a

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/files.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ module.exports = (common) => {
185185
const hash = 'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB'
186186
ipfs.cat(hash, (err, stream) => {
187187
expect(err).to.not.exist
188-
stream.pipe(bl((err, data) => {
188+
stream.pipe(concat((data) => {
189189
expect(err).to.not.exist
190190
expect(data.toString()).to.contain('Check out some of the other files in this directory:')
191191
done()
@@ -197,21 +197,23 @@ module.exports = (common) => {
197197
const hash = 'Qme79tX2bViL26vNjPsF3DP1R9rMKMvnPYJiKTTKPrXJjq'
198198
ipfs.cat(hash, (err, stream) => {
199199
expect(err).to.not.exist
200-
stream.pipe(bl((err, data) => {
200+
stream.pipe(concat((data) => {
201201
expect(err).to.not.exist
202202
expect(data).to.deep.equal(bigFile)
203203
done()
204204
}))
205205
})
206+
})
206207

207-
it('with a multihash', (done) => {
208-
const mhBuf = new Buffer(bs58.decode('QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB'))
209-
ipfs.cat(mhBuf, (err, stream) => {
210-
expect(err).to.not.exist
211-
stream.pipe(concat((data) => {
212-
expect(data.toString()).to.contain('Check out some of the other files in this directory:')
213-
done()
214-
}))
208+
it('with a multihash', (done) => {
209+
const mhBuf = new Buffer(bs58.decode('QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB'))
210+
ipfs.cat(mhBuf, (err, stream) => {
211+
expect(err).to.not.exist
212+
stream.pipe(concat((data) => {
213+
expect(data.toString()).to.contain('Check out some of the other files in this directory:')
214+
done()
215+
}))
216+
})
215217
})
216218
})
217219
})
@@ -306,7 +308,7 @@ module.exports = (common) => {
306308
expect(err).to.not.exist
307309
stream.pipe(concat((files) => {
308310
expect(files).to.be.length(1)
309-
expect(files[0].path).to.deep.equal(hash)
311+
expect(files[0].path).to.deep.equal(mhBuf)
310312
files[0].content.pipe(concat((content) => {
311313
expect(content.toString()).to.contain('Check out some of the other files in this directory:')
312314
done()

0 commit comments

Comments
 (0)