|
| 1 | +/* globals describe, before, it */ |
| 2 | + |
| 3 | +'use strict' |
| 4 | + |
| 5 | +const expect = require('chai').expect |
| 6 | +const IPFS = require('../../src/ipfs-core') |
| 7 | +// const bs58 = require('bs58') |
| 8 | +// const Block = require('ipfs-merkle-dag').Block |
| 9 | + |
| 10 | +// TODO use arrow funtions again when https://github.com/webpack/webpack/issues/1944 is fixed |
| 11 | +describe('object', function () { |
| 12 | + var ipfs |
| 13 | + |
| 14 | + before(function (done) { |
| 15 | + ipfs = new IPFS() |
| 16 | + done() |
| 17 | + }) |
| 18 | + |
| 19 | + it('create', function (done) { |
| 20 | + ipfs.object.create(function (err, obj) { |
| 21 | + expect(err).to.not.exist |
| 22 | + expect(obj).to.have.property('Hash') |
| 23 | + expect(obj).to.have.property('Size') |
| 24 | + expect(obj).to.have.property('Name') |
| 25 | + // depends on https://github.com/ipfs/go-ipfs/issues/2271 |
| 26 | + // expect(bs58.encode(obj.Hash).toString()) |
| 27 | + // .to.equal('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n') |
| 28 | + expect(obj.Size).to.equal(2) |
| 29 | + done() |
| 30 | + }) |
| 31 | + }) |
| 32 | + |
| 33 | + it.skip('patch append-data', function (done) { |
| 34 | + |
| 35 | + }) |
| 36 | + |
| 37 | + it.skip('patch add-link', function (done) { |
| 38 | + |
| 39 | + }) |
| 40 | + |
| 41 | + it.skip('patch rm-link', function (done) { |
| 42 | + |
| 43 | + }) |
| 44 | + |
| 45 | + it.skip('patch set-data', function (done) { |
| 46 | + |
| 47 | + }) |
| 48 | + |
| 49 | + it.skip('patch append-data go-ipfs mDAG obj', function (done) { |
| 50 | + |
| 51 | + }) |
| 52 | + |
| 53 | + it.skip('patch add-link go-ipfs mDAG obj', function (done) { |
| 54 | + |
| 55 | + }) |
| 56 | + |
| 57 | + it.skip('patch rm-link go-ipfs mDAG obj', function (done) { |
| 58 | + |
| 59 | + }) |
| 60 | + |
| 61 | + it.skip('patch set-data go-ipfs mDAG obj', function (done) { |
| 62 | + |
| 63 | + }) |
| 64 | + |
| 65 | + it.skip('data', function (done) { |
| 66 | + |
| 67 | + }) |
| 68 | + |
| 69 | + it.skip('links', function (done) { |
| 70 | + |
| 71 | + }) |
| 72 | + |
| 73 | + it.skip('get', function (done) { |
| 74 | + |
| 75 | + }) |
| 76 | + |
| 77 | + it.skip('get cycle', function (done) { |
| 78 | + // 1. get a go-ipfs marshaled DAG Node |
| 79 | + // 2. store it and fetch it again |
| 80 | + // 3. check if still matches (ipfs-merkle-dag should not mangle it) |
| 81 | + }) |
| 82 | + |
| 83 | + it.skip('put', function (done) { |
| 84 | + |
| 85 | + }) |
| 86 | + |
| 87 | + it.skip('stat', function (done) { |
| 88 | + |
| 89 | + }) |
| 90 | +}) |
0 commit comments