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

Commit 1894216

Browse files
committed
use remote daemon factory
1 parent 4554738 commit 1894216

29 files changed

+83
-100
lines changed

test/bitswap.spec.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ chai.use(dirtyChai)
99
const IPFSApi = require('../src')
1010

1111
const DaemonFactory = require('ipfsd-ctl')
12-
const df = DaemonFactory.create({remote: true, port: 30003})
1312

14-
describe.only('.bitswap', function () {
13+
describe('.bitswap', function () {
1514
this.timeout(20 * 1000) // slow CI
15+
1616
let ipfs
1717
let ipfsd = null
1818

19-
before((done) => {
19+
before(function (done) {
2020
this.timeout(20 * 1000) // slow CI
2121

22+
const df = DaemonFactory.create({remote: true, port: 30003})
23+
2224
df.spawn((err, _ipfsd) => {
2325
expect(err).to.not.exist()
2426
ipfsd = _ipfsd

test/bootstrap.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ chai.use(dirtyChai)
1010
const IPFSApi = require('../src')
1111

1212
const DaemonFactory = require('ipfsd-ctl')
13-
const df = DaemonFactory.create()
1413

1514
const invalidArg = 'this/Is/So/Invalid/'
1615
const validIp4 = '/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z'
@@ -22,6 +21,8 @@ describe('.bootstrap', function () {
2221
let ipfs
2322

2423
before((done) => {
24+
const df = DaemonFactory.create({remote: true, port: 30003})
25+
2526
df.spawn((err, _ipfsd) => {
2627
expect(err).to.not.exist()
2728
ipfsd = _ipfsd

test/commands.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ chai.use(dirtyChai)
99
const IPFSApi = require('../src')
1010

1111
const DaemonFactory = require('ipfsd-ctl')
12-
const df = DaemonFactory.create()
1312

1413
describe('.commands', function () {
1514
this.timeout(20 * 1000)
@@ -18,6 +17,8 @@ describe('.commands', function () {
1817
let ipfs
1918

2019
before((done) => {
20+
const df = DaemonFactory.create({remote: true, port: 30003})
21+
2122
df.spawn((err, _ipfsd) => {
2223
expect(err).to.not.exist()
2324
ipfsd = _ipfsd

test/constructor.spec.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ const expect = chai.expect
77
chai.use(dirtyChai)
88

99
const DaemonFactory = require('ipfsd-ctl')
10-
const df = DaemonFactory.create()
11-
1210
const ipfsAPI = require('../src/index.js')
1311

1412
function clientWorks (client, done) {
@@ -28,6 +26,9 @@ describe('ipfs-api constructor tests', () => {
2826

2927
before(function (done) {
3028
this.timeout(20 * 1000) // slow CI
29+
30+
const df = DaemonFactory.create({remote: true, port: 30003})
31+
3132
df.spawn((err, node) => {
3233
expect(err).to.not.exist()
3334
ipfsd = node

test/diag.spec.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ const os = require('os')
1010
const IPFSApi = require('../src')
1111

1212
const DaemonFactory = require('ipfsd-ctl')
13-
const df = DaemonFactory.create()
1413

1514
describe('.diag', function () {
1615
this.timeout(50 * 1000)
1716

18-
if (os.platform() === 'win32') {
19-
it('skip these on Windows')
20-
return
21-
}
17+
// go-ipfs does not support these on Windows
18+
if (os.platform() === 'win32') { return }
2219

2320
let ipfsd
2421
let ipfs
2522

2623
before((done) => {
24+
const df = DaemonFactory.create({remote: true, port: 30003})
25+
2726
df.spawn((err, _ipfsd) => {
2827
expect(err).to.not.exist()
2928
ipfsd = _ipfsd

test/files.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const CID = require('cids')
1414
const IPFSApi = require('../src')
1515

1616
const DaemonFactory = require('ipfsd-ctl')
17-
const df = DaemonFactory.create()
1817

1918
const testfile = isNode
2019
? loadFixture(__dirname, '/fixtures/testfile.txt')
@@ -41,6 +40,8 @@ describe('.files (the MFS API part)', function () {
4140
const expectedMultihash = 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP'
4241

4342
before((done) => {
43+
const df = DaemonFactory.create({remote: true, port: 30003})
44+
4445
df.spawn((err, _ipfsd) => {
4546
expect(err).to.not.exist()
4647
ipfsd = _ipfsd

test/interface/block.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const parallel = require('async/parallel')
88
const IPFSApi = require('../../src')
99

1010
const DaemonFactory = require('ipfsd-ctl')
11-
const df = DaemonFactory.create()
1211

1312
const nodes = []
1413
const common = {
1514
setup: function (callback) {
15+
const df = DaemonFactory.create({remote: true, port: 30003})
16+
1617
callback(null, {
1718
spawnNode: (cb) => {
1819
df.spawn((err, _ipfsd) => {

test/interface/config.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const parallel = require('async/parallel')
88
const IPFSApi = require('../../src')
99

1010
const DaemonFactory = require('ipfsd-ctl')
11-
const df = DaemonFactory.create()
1211

1312
const nodes = []
1413
const common = {
1514
setup: function (callback) {
15+
const df = DaemonFactory.create({remote: true, port: 30003})
16+
1617
callback(null, {
1718
spawnNode: (cb) => {
1819
df.spawn((err, _ipfsd) => {

test/interface/dht.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ const parallel = require('async/parallel')
77
const IPFSApi = require('../../src')
88

99
const DaemonFactory = require('ipfsd-ctl')
10-
const df = DaemonFactory.create()
1110

1211
const nodes = []
1312
const common = {
1413
setup: function (callback) {
14+
const df = DaemonFactory.create({remote: true, port: 30003})
15+
1516
callback(null, {
1617
spawnNode: (cb) => {
1718
df.spawn((err, _ipfsd) => {

test/interface/files.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const parallel = require('async/parallel')
88
const IPFSApi = require('../../src')
99

1010
const DaemonFactory = require('ipfsd-ctl')
11-
const df = DaemonFactory.create()
1211

1312
const nodes = []
1413
const common = {
1514
setup: function (callback) {
15+
const df = DaemonFactory.create({remote: true, port: 30003})
16+
1617
callback(null, {
1718
spawnNode: (cb) => {
1819
df.spawn((err, _ipfsd) => {

test/interface/key.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const parallel = require('async/parallel')
88
const IPFSApi = require('../../src')
99

1010
const DaemonFactory = require('ipfsd-ctl')
11-
const df = DaemonFactory.create()
1211

1312
const nodes = []
1413
const common = {
1514
setup: function (callback) {
15+
const df = DaemonFactory.create({remote: true, port: 30003})
16+
1617
callback(null, {
1718
spawnNode: (cb) => {
1819
df.spawn((err, _ipfsd) => {

test/interface/miscellaneous.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ const test = require('interface-ipfs-core')
77
const IPFSApi = require('../../src')
88

99
const DaemonFactory = require('ipfsd-ctl')
10-
const df = DaemonFactory.create()
1110

1211
const nodes = []
1312
const common = {
1413
setup: function (callback) {
14+
const df = DaemonFactory.create({remote: true, port: 30003})
15+
1516
callback(null, {
1617
spawnNode: (cb) => {
1718
df.spawn((err, _ipfsd) => {

test/interface/object.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const parallel = require('async/parallel')
88
const IPFSApi = require('../../src')
99

1010
const DaemonFactory = require('ipfsd-ctl')
11-
const df = DaemonFactory.create()
1211

1312
const nodes = []
1413
const common = {
1514
setup: function (callback) {
15+
const df = DaemonFactory.create({remote: true, port: 30003})
16+
1617
callback(null, {
1718
spawnNode: (cb) => {
1819
df.spawn((err, _ipfsd) => {

test/interface/pin.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const parallel = require('async/parallel')
88
const IPFSApi = require('../../src')
99

1010
const DaemonFactory = require('ipfsd-ctl')
11-
const df = DaemonFactory.create()
1211

1312
const nodes = []
1413
const common = {
1514
setup: function (callback) {
15+
const df = DaemonFactory.create({remote: true, port: 30003})
16+
1617
callback(null, {
1718
spawnNode: (cb) => {
1819
df.spawn((err, _ipfsd) => {

test/interface/pubsub.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ const parallel = require('async/parallel')
1010
const IPFSApi = require('../../src')
1111

1212
const DaemonFactory = require('ipfsd-ctl')
13-
const df = DaemonFactory.create()
1413

1514
if (isNode) {
1615
const nodes = []
1716
const common = {
1817
setup: function (callback) {
18+
const df = DaemonFactory.create({remote: true, port: 30003})
19+
1920
callback(null, {
2021
spawnNode: (cb) => {
2122
df.spawn({ args: ['--enable-pubsub-experiment'] },

test/interface/repo.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const parallel = require('async/parallel')
88
const IPFSApi = require('../../src')
99

1010
const DaemonFactory = require('ipfsd-ctl')
11-
const df = DaemonFactory.create()
1211

1312
const nodes = []
1413
const common = {
1514
setup: function (callback) {
15+
const df = DaemonFactory.create({remote: true, port: 30003})
16+
1617
callback(null, {
1718
spawnNode: (cb) => {
1819
df.spawn((err, _ipfsd) => {

test/interface/stats.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const parallel = require('async/parallel')
88
const IPFSApi = require('../../src')
99

1010
const DaemonFactory = require('ipfsd-ctl')
11-
const df = DaemonFactory.create()
1211

1312
const nodes = []
1413
const common = {
1514
setup: function (callback) {
15+
const df = DaemonFactory.create({remote: true, port: 30003})
16+
1617
callback(null, {
1718
spawnNode: (cb) => {
1819
df.spawn((err, _ipfsd) => {

test/interface/swarm.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const parallel = require('async/parallel')
88
const IPFSApi = require('../../src')
99

1010
const DaemonFactory = require('ipfsd-ctl')
11-
const df = DaemonFactory.create()
1211

1312
const nodes = []
1413
const common = {
1514
setup: function (callback) {
15+
const df = DaemonFactory.create({remote: true, port: 30003})
16+
1617
callback(null, {
1718
spawnNode: (repoPath, config, cb) => {
1819
if (typeof repoPath === 'function') {

test/key.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ chai.use(dirtyChai)
1010
const IPFSApi = require('../src')
1111

1212
const DaemonFactory = require('ipfsd-ctl')
13-
const df = DaemonFactory.create()
1413

1514
describe('.key', function () {
1615
this.timeout(50 * 1000)
@@ -19,6 +18,8 @@ describe('.key', function () {
1918
let ipfs
2019

2120
before((done) => {
21+
const df = DaemonFactory.create({remote: true, port: 30003})
22+
2223
df.spawn((err, _ipfsd) => {
2324
expect(err).to.not.exist()
2425
ipfsd = _ipfsd

test/log.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ chai.use(dirtyChai)
1010
const IPFSApi = require('../src')
1111

1212
const DaemonFactory = require('ipfsd-ctl')
13-
const df = DaemonFactory.create()
1413

1514
describe('.log', function () {
1615
this.timeout(100 * 1000)
@@ -19,6 +18,8 @@ describe('.log', function () {
1918
let ipfs
2019

2120
before((done) => {
21+
const df = DaemonFactory.create({remote: true, port: 30003})
22+
2223
df.spawn((err, _ipfsd) => {
2324
expect(err).to.not.exist()
2425
ipfsd = _ipfsd

test/mount.spec.js

-7
This file was deleted.

test/name.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const loadFixture = require('aegir/fixtures')
1414
const IPFSApi = require('../src')
1515

1616
const DaemonFactory = require('ipfsd-ctl')
17-
const df = DaemonFactory.create()
1817

1918
const testfile = isNode
2019
? loadFixture(__dirname, '/fixtures/testfile.txt')
@@ -29,6 +28,8 @@ describe('.name', function () {
2928
let otherd
3029

3130
before((done) => {
31+
const df = DaemonFactory.create({remote: true, port: 30003})
32+
3233
series([
3334
(cb) => {
3435
df.spawn((err, _ipfsd) => {

test/ping.spec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const series = require('async/series')
1212
const IPFSApi = require('../src')
1313

1414
const DaemonFactory = require('ipfsd-ctl')
15-
const df = DaemonFactory.create()
1615

1716
describe.skip('.ping', () => {
1817
let ipfs
@@ -22,6 +21,9 @@ describe.skip('.ping', () => {
2221

2322
before(function (done) {
2423
this.timeout(20 * 1000) // slow CI
24+
25+
const df = DaemonFactory.create({remote: true, port: 30003})
26+
2527
series([
2628
(cb) => {
2729
df.spawn((err, _ipfsd) => {

test/pubsub-in-browser.spec.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,21 @@ chai.use(dirtyChai)
3535
const IPFSApi = require('../src')
3636

3737
const DaemonFactory = require('ipfsd-ctl')
38-
const df = DaemonFactory.create()
3938

4039
const expectedError = 'pubsub is currently not supported when run in the browser'
4140

42-
describe('.pubsub-browser (pubsub not supported in the browsers currently)', function () {
41+
describe('.pubsub is not supported in the browser, yet!', function () {
4342
this.timeout(50 * 1000)
4443

45-
if (isNode) {
46-
it('skip these in Node.js')
47-
return
48-
}
49-
const topic = 'pubsub-tests'
44+
if (isNode) { return }
5045

46+
const topic = 'pubsub-tests'
5147
let ipfs
5248
let ipfsd
5349

5450
before((done) => {
51+
const df = DaemonFactory.create({remote: true, port: 30003})
52+
5553
df.spawn((err, _ipfsd) => {
5654
expect(err).to.not.exist()
5755
ipfsd = _ipfsd

0 commit comments

Comments
 (0)