Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
feat(factory): use the factory mode
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Aug 11, 2016
1 parent 6948370 commit 7a1b9d6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"aegir": "^6.0.0",
"chai": "^3.5.0",
"gulp": "^3.9.1",
"interface-ipfs-core": "^0.6.0",
"interface-ipfs-core": "^0.7.2",
"ipfsd-ctl": "^0.14.0",
"passthrough-counter": "^1.0.0",
"pre-commit": "^1.1.3",
Expand Down
16 changes: 15 additions & 1 deletion test/api/files.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@ testfile = require('fs').readFileSync(path.join(__dirname, '/../testfile.txt'))
// Load the add/cat/get/ls commands from interface-ipfs-core
const common = {
setup: function (cb) {
cb(null, apiClients.a)
let c = 0
cb(null, {
spawnNode: (path, config, callback) => {
if (typeof path === 'function') {
callback = path
path = undefined
}
switch (c) {
case 0: callback(null, apiClients.a); c++; break
case 1: callback(null, apiClients.b); c++; break
case 2: callback(null, apiClients.c); c++; break
default: callback(new Error('no more nodes available'))
}
}
})
},
teardown: function (cb) {
cb()
Expand Down
12 changes: 11 additions & 1 deletion test/api/object.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ const test = require('interface-ipfs-core')

const common = {
setup: function (cb) {
cb(null, apiClients.a)
let c = 0
cb(null, {
spawnNode: (path, config, callback) => {
switch (c) {
case 0: callback(null, apiClients.a); c++; break
case 1: callback(null, apiClients.b); c++; break
case 2: callback(null, apiClients.c); c++; break
default: callback(new Error('no more nodes available'))
}
}
})
},
teardown: function (cb) {
cb()
Expand Down
12 changes: 0 additions & 12 deletions test/notes.org

This file was deleted.

0 comments on commit 7a1b9d6

Please sign in to comment.