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

Commit 5a16909

Browse files
authored
Merge branch 'master' into revamp-stream-apis
2 parents c15527e + 6849a67 commit 5a16909

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
<a name="0.34.2"></a>
2+
## [0.34.2](https://github.com/ipfs/interface-ipfs-core/compare/v0.34.0...v0.34.2) (2017-11-13)
3+
4+
5+
6+
<a name="0.34.1"></a>
7+
## [0.34.1](https://github.com/ipfs/interface-ipfs-core/compare/v0.34.0...v0.34.1) (2017-11-13)
8+
9+
10+
111
<a name="0.34.0"></a>
212
# [0.34.0](https://github.com/ipfs/interface-ipfs-core/compare/v0.33.2...v0.34.0) (2017-11-13)
313

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "interface-ipfs-core",
3-
"version": "0.34.0",
3+
"version": "0.34.2",
44
"description": "A test suite and interface you can use to implement a IPFS core interface.",
55
"main": "src/index.js",
66
"scripts": {

src/files.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -663,15 +663,20 @@ module.exports = (common) => {
663663

664664
// TODO upgrade
665665
describe('.ls', () => {
666-
it('with a base58 encoded string', () => {
666+
it('with a base58 encoded string', (done) => {
667667
const hash = 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP'
668-
return ipfs.files.ls(hash).then((stream) => {
669-
return new Promise((resolve, reject) => {
670-
stream.pipe(concat((files) => {
671-
expect(files).to.be.length(6)
672-
// remove content so that we can compare
673-
files.forEach((file) => delete file.content)
674-
expect(files).to.deep.equal([ { depth: 1,
668+
ipfs.ls(hash, (err, stream) => {
669+
expect(err).to.not.exist()
670+
671+
stream.pipe(concat(gotFiles))
672+
673+
function gotFiles (files) {
674+
expect(files).to.be.length(6)
675+
// remove content so that we can compare
676+
files.forEach((file) => delete file.content)
677+
678+
expect(files).to.eql([
679+
{ depth: 1,
675680
name: 'alice.txt',
676681
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/alice.txt',
677682
size: 11696,
@@ -706,9 +711,10 @@ module.exports = (common) => {
706711
path: 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP/pp.txt',
707712
size: 4551,
708713
hash: 'QmVwdDCY4SPGVFnNCiZnX5CtzwWDn6kAM98JXzKxE3kCmn',
709-
type: 'file' } ])
710-
resolve()
711-
}))
714+
type: 'file'
715+
}
716+
])
717+
}
712718
})
713719
})
714720
})

0 commit comments

Comments
 (0)