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(tests) move some bitswap tests to interface
Will require including the version of interface-ipfs-core that they are moved to
- Loading branch information
Showing
10 changed files
with
120 additions
and
108 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
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
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,35 @@ | ||
/* 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({ | ||
initOptions: { bits: 512 } | ||
}, (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.bitswap(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
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({ initOptions: { bits: 512 } }, (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.bitswap(common) |