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

Commit 2d0c802

Browse files
tests are starting
1 parent 213e1db commit 2d0c802

File tree

10 files changed

+22
-26
lines changed

10 files changed

+22
-26
lines changed

.aegir.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
'use strict'
22

3-
const path = require('path')
4-
53
module.exports = {
64
webpack: {
75
resolve: {
86
alias: {
9-
'libp2p-ipfs': 'libp2p-ipfs-browser',
10-
'node-forge': path.resolve(
11-
path.dirname(require.resolve('libp2p-crypto')),
12-
'../vendor/forge.bundle.js'
13-
)
7+
'libp2p-ipfs': 'libp2p-ipfs-browser'
148
}
159
},
1610
externals: {

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let nodes = []
1111
function startNode (num, done) {
1212
createTempNode(num, (err, node) => {
1313
if (err) {
14-
throw err
14+
return done(err)
1515
}
1616

1717
const api = new API(node.repo.path())

src/core/components/load.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ module.exports = function load (self) {
1313
(cb) => utils.ifRepoExists(self._repo, cb),
1414
(cb) => self._repo.config.get(cb),
1515
(config, cb) => {
16-
const id = peerId.createFromPrivKey(config.Identity.PrivKey)
17-
16+
peerId.createFromPrivKey(config.Identity.PrivKey, (err, id) => {
17+
cb(err, config, id)
18+
})
19+
},
20+
(config, id, cb) => {
1821
self._peerInfo = new PeerInfo(id)
1922
config.Addresses.Swarm.forEach((addr) => {
2023
self._peerInfo.multiaddr.add(multiaddr(addr))

test/cli/test-init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ describe('init', function () {
3535
})
3636

3737
it('bits', (done) => {
38-
nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'init', '--bits', '512'], {env})
38+
nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'init', '--bits', '1024'], {env})
3939
.run((err, stdout, exitcode) => {
4040
expect(err).to.not.exist
4141
done()
4242
})
4343
})
4444

4545
it('empty', (done) => {
46-
nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'init', '--bits', '512', '--empty-repo', 'true'], {env})
46+
nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'init', '--bits', '1024', '--empty-repo', 'true'], {env})
4747
.run((err, stdout, exitcode) => {
4848
expect(err).to.not.exist
4949
expect(repoExistsSync('blocks')).to.equal(false)

test/core/both/test-init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('init', function () {
1313
const repo = createTempRepo()
1414
const ipfs = new IPFS(repo)
1515

16-
ipfs.init({ emptyRepo: true, bits: 512 }, (err) => {
16+
ipfs.init({ emptyRepo: true, bits: 1024 }, (err) => {
1717
expect(err).to.not.exist
1818

1919
repo.exists((err, res) => {
@@ -35,7 +35,7 @@ describe('init', function () {
3535
const repo2 = createTempRepo()
3636
const ipfsShort = new IPFS(repo1)
3737
const ipfsLong = new IPFS(repo2)
38-
ipfsShort.init({ bits: 512, emptyRepo: true }, (err) => {
38+
ipfsShort.init({ bits: 1024, emptyRepo: true }, (err) => {
3939
expect(err).to.not.exist
4040

4141
ipfsLong.init({ bits: 1024, emptyRepo: true }, (err) => {

test/core/node-only/test-init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('init (Node.js specific)', function () {
2323
})
2424

2525
it('init docs are written', (done) => {
26-
ipfs.init({ bits: 512 }, (err) => {
26+
ipfs.init({ bits: 1024 }, (err) => {
2727
expect(err).to.not.exist
2828
var multihash = new Buffer('12205e7c3ce237f936c76faf625e90f7751a9f5eeb048f59873303c215e9cce87599', 'hex')
2929
setTimeout(() => {
@@ -37,7 +37,7 @@ describe('init (Node.js specific)', function () {
3737
})
3838

3939
it('empty repo', (done) => {
40-
ipfs.init({ bits: 512, emptyRepo: true }, (err) => {
40+
ipfs.init({ bits: 1024, emptyRepo: true }, (err) => {
4141
expect(err).to.not.exist
4242

4343
// Check for default assets

test/utils/factory-core/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function Factory () {
6969

7070
// create the IPFS node
7171
const ipfs = new IPFS(repo)
72-
ipfs.init({ emptyRepo: true, bits: 512 }, (err) => {
72+
ipfs.init({ emptyRepo: true, bits: 1024 }, (err) => {
7373
if (err) {
7474
return callback(err)
7575
}
@@ -104,7 +104,7 @@ function Factory () {
104104
}
105105
const conf = JSON.parse(JSON.stringify(defaultConfig))
106106

107-
PeerId.create({ bits: 512 }, (err, id) => {
107+
PeerId.create({ bits: 1024 }, (err, id) => {
108108
if (err) {
109109
return cb(err)
110110
}

test/utils/factory-http/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function Factory () {
5252

5353
// create the IPFS node
5454
const ipfs = new IPFS(repo)
55-
ipfs.init({ emptyRepo: true, bits: 512 }, (err) => {
55+
ipfs.init({ emptyRepo: true, bits: 1024 }, (err) => {
5656
if (err) {
5757
return callback(err)
5858
}
@@ -84,7 +84,7 @@ function Factory () {
8484
}
8585
const conf = JSON.parse(JSON.stringify(defaultConfig))
8686

87-
PeerId.create({ bits: 512 }, (err, id) => {
87+
PeerId.create({ bits: 1024 }, (err, id) => {
8888
if (err) {
8989
return cb(err)
9090
}

test/utils/temp-node.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const expect = require('chai').expect
54
const leftPad = require('left-pad')
65
const series = require('run-series')
76

@@ -10,7 +9,9 @@ const createTempRepo = require('./temp-repo')
109

1110
function setAddresses (repo, num, callback) {
1211
repo.config.get((err, config) => {
13-
expect(err).to.not.exist
12+
if (err) {
13+
return callback(err)
14+
}
1415
config.Addresses = {
1516
Swarm: [
1617
`/ip4/127.0.0.1/tcp/10${num}`,
@@ -19,7 +20,6 @@ function setAddresses (repo, num, callback) {
1920
API: `/ip4/127.0.0.1/tcp/31${num}`,
2021
Gateway: `/ip4/127.0.0.1/tcp/32${num}`
2122
}
22-
2323
repo.config.set(config, callback)
2424
})
2525
}
@@ -31,7 +31,7 @@ function createTempNode (num, callback) {
3131
num = leftPad(num, 3, 0)
3232

3333
series([
34-
(cb) => ipfs.init({ emptyRepo: true, bits: 512 }, cb),
34+
(cb) => ipfs.init({ emptyRepo: true, bits: 1024 }, cb),
3535
(cb) => setAddresses(repo, num, cb),
3636
(cb) => ipfs.load(cb)
3737
], (err) => {

test/utils/temp-repo.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const clean = require('./clean')
66

77
function createTempRepo () {
88
const repoPath = '/tmp/ipfs-test-' + Math.random().toString().substring(2, 8)
9-
109
let store
1110
let teardown
1211

@@ -31,7 +30,7 @@ function createTempRepo () {
3130
}
3231

3332
var repo = new IPFSRepo(repoPath, {
34-
bits: 512,
33+
bits: 1024,
3534
stores: store
3635
})
3736

0 commit comments

Comments
 (0)