This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Bootstrap API compliance (#1218)
- Loading branch information
1 parent
203d912
commit 60b7a44
Showing
6 changed files
with
93 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-env mocha */ | ||
'use strict' | ||
|
||
const test = require('interface-ipfs-core') | ||
const parallel = require('async/parallel') | ||
|
||
const IPFS = require('../../../src') | ||
|
||
const DaemonFactory = require('ipfsd-ctl') | ||
const df = DaemonFactory.create({ type: 'proc', exec: IPFS }) | ||
|
||
const nodes = [] | ||
const common = { | ||
setup: function (callback) { | ||
callback(null, { | ||
spawnNode: (cb) => { | ||
df.spawn((err, _ipfsd) => { | ||
if (err) { | ||
return cb(err) | ||
} | ||
|
||
nodes.push(_ipfsd) | ||
cb(null, _ipfsd.api) | ||
}) | ||
} | ||
}) | ||
}, | ||
teardown: function (callback) { | ||
parallel(nodes.map((node) => (cb) => node.stop(cb)), callback) | ||
} | ||
} | ||
|
||
test.bootstrap(common) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-env mocha */ | ||
'use strict' | ||
|
||
const test = require('interface-ipfs-core') | ||
const parallel = require('async/parallel') | ||
|
||
const DaemonFactory = require('ipfsd-ctl') | ||
const df = DaemonFactory.create({ exec: 'src/cli/bin.js' }) | ||
|
||
const nodes = [] | ||
const common = { | ||
setup: function (callback) { | ||
callback(null, { | ||
spawnNode: (cb) => { | ||
df.spawn((err, _ipfsd) => { | ||
if (err) { | ||
return cb(err) | ||
} | ||
|
||
nodes.push(_ipfsd) | ||
cb(null, _ipfsd.api) | ||
}) | ||
} | ||
}) | ||
}, | ||
teardown: function (callback) { | ||
parallel(nodes.map((node) => (cb) => node.stop(cb)), callback) | ||
} | ||
} | ||
|
||
test.bootstrap(common) |