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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs-inactive/interface-js-ipfs-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.36.0
Choose a base ref
...
head repository: ipfs-inactive/interface-js-ipfs-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.36.1
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Nov 17, 2017

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5808f0b View commit details
  2. chore: update contributors

    daviddias committed Nov 17, 2017
    Copy the full SHA
    46d2503 View commit details
  3. Copy the full SHA
    022952c View commit details
Showing with 36 additions and 5 deletions.
  1. +5 −0 CHANGELOG.md
  2. +1 −1 package.json
  3. +30 −4 src/files.js
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<a name="0.36.1"></a>
## [0.36.1](https://github.com/ipfs/interface-ipfs-core/compare/v0.36.0...v0.36.1) (2017-11-17)



<a name="0.36.0"></a>
# [0.36.0](https://github.com/ipfs/interface-ipfs-core/compare/v0.35.0...v0.36.0) (2017-11-17)

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "interface-ipfs-core",
"version": "0.36.0",
"version": "0.36.1",
"description": "A test suite and interface you can use to implement a IPFS core interface.",
"main": "src/index.js",
"scripts": {
34 changes: 30 additions & 4 deletions src/files.js
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ const Readable = require('readable-stream').Readable
const pull = require('pull-stream')
const concat = require('concat-stream')
const through = require('through2')
const path = require('path')
const bl = require('bl')

module.exports = (common) => {
@@ -129,6 +130,15 @@ module.exports = (common) => {
})
})

it('add by path fails', (done) => {
const validPath = path.join(process.cwd() + '/package.json')

ipfs.files.add(validPath, (err, res) => {
expect(err).to.exist()
done()
})
})

it('a Readable Stream', (done) => {
const expectedCid = 'QmVv4Wz46JaZJeH5PMV4LGbRiiMKEmszPYY3g6fjGnVXBS'

@@ -209,14 +219,14 @@ module.exports = (common) => {
accumProgress += p
}

ipfs.files.add(dirs, { progress: handler }, (err, res) => {
ipfs.files.add(dirs, { progress: handler }, (err, filesAdded) => {
expect(err).to.not.exist()
const root = res[res.length - 1]
const root = filesAdded[filesAdded.length - 1]

expect(root.path).to.equal('test-folder')
expect(root.hash).to.equal(directory.cid)
expect(progCount).to.equal(8)
expect(accumProgress).to.be.at.least(total)
expect(root.path).to.equal('test-folder')
expect(root.hash).to.equal(directory.cid)
done()
})
})
@@ -729,6 +739,22 @@ module.exports = (common) => {
done()
})
})

it('should correctly handle a non existing hash', (done) => {
ipfs.ls('surelynotavalidhashheh?', (err, res) => {
expect(err).to.exist()
expect(res).to.not.exist()
done()
})
})

it('should correctly handle a non exiting path', (done) => {
ipfs.ls('QmRNjDeKStKGTQXnJ2NFqeQ9oW/folder_that_isnt_there', (err, res) => {
expect(err).to.exist()
expect(res).to.not.exist()
done()
})
})
})

describe('.lsReadableStream', () => {