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

Commit 61fd705

Browse files
committed
feat(factory): use the factory mode
1 parent 6948370 commit 61fd705

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"aegir": "^6.0.0",
3434
"chai": "^3.5.0",
3535
"gulp": "^3.9.1",
36-
"interface-ipfs-core": "^0.6.0",
36+
"interface-ipfs-core": "^0.7.0",
3737
"ipfsd-ctl": "^0.14.0",
3838
"passthrough-counter": "^1.0.0",
3939
"pre-commit": "^1.1.3",

test/api/files.spec.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,21 @@ testfile = require('fs').readFileSync(path.join(__dirname, '/../testfile.txt'))
1515
// Load the add/cat/get/ls commands from interface-ipfs-core
1616
const common = {
1717
setup: function (cb) {
18-
cb(null, apiClients.a)
18+
let c = 0
19+
cb(null, {
20+
spawnNode: (path, config, callback) => {
21+
if (typeof path === 'function') {
22+
callback = path
23+
path = undefined
24+
}
25+
switch (c) {
26+
case 0: callback(null, apiClients.a); c++; break
27+
case 1: callback(null, apiClients.b); c++; break
28+
case 2: callback(null, apiClients.c); c++; break
29+
default: callback(new Error('no more nodes available'))
30+
}
31+
}
32+
})
1933
},
2034
teardown: function (cb) {
2135
cb()

test/api/object.spec.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ const test = require('interface-ipfs-core')
77

88
const common = {
99
setup: function (cb) {
10-
cb(null, apiClients.a)
10+
let c = 0
11+
cb(null, {
12+
spawnNode: (path, config, callback) => {
13+
switch (c) {
14+
case 0: callback(null, apiClients.a); c++; break
15+
case 1: callback(null, apiClients.b); c++; break
16+
case 2: callback(null, apiClients.c); c++; break
17+
default: callback(new Error('no more nodes available'))
18+
}
19+
}
20+
})
1121
},
1222
teardown: function (cb) {
1323
cb()

test/notes.org

-12
This file was deleted.

0 commit comments

Comments
 (0)