From f78c70a9d93865cf08ed85561b62654f29997a69 Mon Sep 17 00:00:00 2001 From: jonybang Date: Fri, 10 May 2019 12:20:31 +0200 Subject: [PATCH 1/3] fix: add ipld to validation config of options --- src/core/config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/config.js b/src/core/config.js index 7848e69f0e..2fb66bb558 100644 --- a/src/core/config.js +++ b/src/core/config.js @@ -68,6 +68,7 @@ const configSchema = s({ })), Bootstrap: optional(s(['multiaddr-ipfs'])) })), + ipld: 'object?', libp2p: optional(union(['function', 'object'])) // libp2p validates this }, { repoOwner: true From 8b1383ccaf6dcd12e5cbd451407ec8204b76318c Mon Sep 17 00:00:00 2001 From: jonybang Date: Sun, 12 May 2019 13:10:04 +0200 Subject: [PATCH 2/3] test: pass ipld options --- test/core/init.spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/core/init.spec.js b/test/core/init.spec.js index 62372c48c0..151683fe37 100644 --- a/test/core/init.spec.js +++ b/test/core/init.spec.js @@ -103,4 +103,11 @@ describe('init', () => { }) }) }) + + it('ipld options', (done) => { + ipfs.init({ bits: 512, ipld: { formats: [require('ipld-dag-cbor'), require('ipld-dag-pb'), require('ipld-raw')] } }, (err) => { + expect(err).to.not.exist() + done() + }) + }) }) From 0e14835a4ca24ddaf0358a4ae20bdb4f107ae7a8 Mon Sep 17 00:00:00 2001 From: jonybang Date: Mon, 13 May 2019 12:26:44 +0200 Subject: [PATCH 3/3] test: move ipld options test to create-node --- test/core/create-node.spec.js | 14 ++++++++++++++ test/core/init.spec.js | 7 ------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/test/core/create-node.spec.js b/test/core/create-node.spec.js index cf5ba30e43..4fdf708720 100644 --- a/test/core/create-node.spec.js +++ b/test/core/create-node.spec.js @@ -409,4 +409,18 @@ describe('create node', function () { }) }) }) + + it('ipld: { }', function (done) { + this.timeout(80 * 1000) + + const node = new IPFS({ + repo: tempRepo, + ipld: {} + }) + + node.once('start', (err) => { + expect(err).to.not.exist() + done() + }) + }) }) diff --git a/test/core/init.spec.js b/test/core/init.spec.js index 151683fe37..62372c48c0 100644 --- a/test/core/init.spec.js +++ b/test/core/init.spec.js @@ -103,11 +103,4 @@ describe('init', () => { }) }) }) - - it('ipld options', (done) => { - ipfs.init({ bits: 512, ipld: { formats: [require('ipld-dag-cbor'), require('ipld-dag-pb'), require('ipld-raw')] } }, (err) => { - expect(err).to.not.exist() - done() - }) - }) })