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

Commit 77436dc

Browse files
committed
chore: update aegir and fix linting
1 parent 10cdb82 commit 77436dc

24 files changed

+222
-154
lines changed

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"scripts": {
2424
"lint": "aegir-lint",
2525
"coverage": "gulp coverage",
26-
"test": "gulp test",
26+
"test": "gulp test --dom",
2727
"test:node": "npm run test:unit:node",
28-
"test:browser": "npm run test:unit:browser",
28+
"test:browser": "npm run test:unit:browser --dom",
2929
"test:unit:node": "gulp test:node",
3030
"test:unit:node:core": "TEST=core npm run test:unit:node",
3131
"test:unit:node:http": "TEST=http npm run test:unit:node",
@@ -40,9 +40,9 @@
4040
"test:benchmark:node:http": "echo \"Error: no benchmarks yet\" && exit 1",
4141
"test:benchmark:browser": "echo \"Error: no benchmarks yet\" && exit 1",
4242
"build": "gulp build",
43-
"release": "gulp release",
44-
"release-minor": "gulp release --type minor",
45-
"release-major": "gulp release --type major",
43+
"release": "gulp release --dom",
44+
"release-minor": "gulp release --type minor --dom",
45+
"release-major": "gulp release --type major --dom",
4646
"coverage-publish": "aegir-coverage publish"
4747
},
4848
"pre-commit": [
@@ -63,12 +63,13 @@
6363
},
6464
"homepage": "https://github.com/ipfs/js-ipfs#readme",
6565
"devDependencies": {
66-
"aegir": "^10.0.0",
66+
"aegir": "^11.0.0",
6767
"buffer-loader": "0.0.1",
6868
"chai": "^3.5.0",
6969
"delay": "^1.3.1",
7070
"detect-node": "^2.0.3",
7171
"dir-compare": "^1.3.0",
72+
"dirty-chai": "^1.2.2",
7273
"eslint-plugin-react": "^6.10.0",
7374
"execa": "^0.6.1",
7475
"expose-loader": "^0.7.3",
@@ -93,8 +94,8 @@
9394
"async": "^2.1.5",
9495
"bl": "^1.2.0",
9596
"boom": "^4.2.0",
96-
"debug": "^2.6.2",
97-
"cids": "^0.4.1",
97+
"debug": "^2.6.3",
98+
"cids": "^0.4.2",
9899
"fs-pull-blob-store": "~0.4.1",
99100
"glob": "^7.1.1",
100101
"hapi": "^16.1.0",
@@ -109,7 +110,7 @@
109110
"ipfs-repo": "~0.11.3",
110111
"ipfs-unixfs": "~0.1.11",
111112
"ipfs-unixfs-engine": "~0.17.0",
112-
"ipld-resolver": "~0.10.0",
113+
"ipld-resolver": "~0.10.1",
113114
"isstream": "^0.1.2",
114115
"joi": "^10.2.2",
115116
"libp2p-floodsub": "~0.7.4",
@@ -123,12 +124,12 @@
123124
"lodash.values": "^4.3.0",
124125
"mafmt": "^2.1.6",
125126
"mkdirp": "^0.5.1",
126-
"multiaddr": "^2.2.1",
127-
"multihashes": "~0.4.3",
127+
"multiaddr": "^2.2.2",
128+
"multihashes": "~0.4.4",
128129
"path-exists": "^3.0.0",
129130
"peer-book": "~0.3.1",
130-
"peer-id": "~0.8.2",
131-
"peer-info": "~0.8.3",
131+
"peer-id": "~0.8.4",
132+
"peer-info": "~0.8.4",
132133
"promisify-es6": "^1.0.2",
133134
"pull-file": "^1.0.0",
134135
"pull-paramap": "^1.2.1",

src/cli/bin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ aliases.forEach((alias) => {
2828
})
2929

3030
// finalize cli setup
31-
cli.help()
31+
cli // eslint-disable-line
32+
.help()
3233
.strict()
3334
.completion()
34-
.argv
35+
.argv

src/core/components/object.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ module.exports = function object (self) {
140140
node = _node
141141
next()
142142
})
143-
return
144143
} else {
145144
DAGNode.create(obj, (err, _node) => {
146145
if (err) {

src/http-api/resources/repo.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
'use strict'
2-

test/cli/config.js

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

4-
const expect = require('chai').expect
4+
const chai = require('chai')
5+
const dirtyChai = require('dirty-chai')
6+
const expect = chai.expect
7+
chai.use(dirtyChai)
58
const fs = require('fs')
69
const path = require('path')
710
const runOnAndOff = require('../utils/on-and-off')
@@ -52,7 +55,7 @@ describe('config', () => runOnAndOff((thing) => {
5255

5356
it('get a config key value', () => {
5457
return ipfs('config Identity.PeerID').then((out) => {
55-
expect(out).to.exist
58+
expect(out).to.exist()
5659
})
5760
})
5861

test/cli/pubsub.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
/* eslint-env mocha */
33
'use strict'
44

5-
const expect = require('chai').expect
5+
const chai = require('chai')
6+
const dirtyChai = require('dirty-chai')
7+
const expect = chai.expect
8+
chai.use(dirtyChai)
69
const delay = require('delay')
710
const waterfall = require('async/waterfall')
811
const HttpAPI = require('../../src/http-api')
@@ -20,7 +23,7 @@ describe.skip('pubsub', () => {
2023

2124
before((done) => {
2225
createTempNode(1, (err, _node) => {
23-
expect(err).to.not.exist
26+
expect(err).to.not.exist()
2427
node = _node
2528
node.goOnline(done)
2629
})

test/cli/swarm.js

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

5-
const expect = require('chai').expect
5+
const chai = require('chai')
6+
const dirtyChai = require('dirty-chai')
7+
const expect = chai.expect
8+
chai.use(dirtyChai)
69
const series = require('async/series')
710
const ipfsExec = require('../utils/ipfs-exec')
811
const Factory = require('../utils/ipfs-factory-daemon')
@@ -23,16 +26,16 @@ describe('swarm', () => {
2326
series([
2427
(cb) => {
2528
factory.spawnNode((err, node) => {
26-
expect(err).to.not.exist
29+
expect(err).to.not.exist()
2730
ipfsA = ipfsExec(node.repoPath)
2831
cb()
2932
})
3033
},
3134
(cb) => {
3235
factory.spawnNode((err, node) => {
33-
expect(err).to.not.exist
36+
expect(err).to.not.exist()
3437
node.id((err, id) => {
35-
expect(err).to.not.exist
38+
expect(err).to.not.exist()
3639
bMultiaddr = id.addresses[0]
3740
cb()
3841
})

test/core/bitswap.spec.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
/* eslint-env mocha */
33
'use strict'
44

5-
const expect = require('chai').expect
5+
const chai = require('chai')
6+
const dirtyChai = require('dirty-chai')
7+
const expect = chai.expect
8+
chai.use(dirtyChai)
69
const _ = require('lodash')
710
const series = require('async/series')
811
const waterfall = require('async/waterfall')
@@ -70,7 +73,7 @@ describe('bitswap', () => {
7073
describe('connections', () => {
7174
function wire (targetNode, dialerNode, done) {
7275
targetNode.id((err, identity) => {
73-
expect(err).to.not.exist
76+
expect(err).to.not.exist()
7477
const addr = identity.addresses
7578
.map((addr) => {
7679
const ma = multiaddr(addr.toString().split('ipfs')[0])
@@ -156,10 +159,10 @@ describe('bitswap', () => {
156159

157160
series([
158161
(cb) => parallel(_.range(6).map((i) => makeBlock), (err, _blocks) => {
159-
expect(err).to.not.exist
162+
expect(err).to.not.exist()
160163
blocks = _blocks
161164
map(blocks, (b, cb) => b.key('sha2-256', cb), (err, res) => {
162-
expect(err).to.not.exist
165+
expect(err).to.not.exist()
163166
keys = res
164167
cb()
165168
})
@@ -183,7 +186,7 @@ describe('bitswap', () => {
183186
(cb) => parallel(_.range(6).map((i) => (cbI) => {
184187
const check = (n, k, callback) => {
185188
n.block.get(k, (err, b) => {
186-
expect(err).to.not.exist
189+
expect(err).to.not.exist()
187190
expect(
188191
(b.data || b).toString()
189192
).to.be.eql(
@@ -223,7 +226,7 @@ describe('bitswap', () => {
223226
},
224227
(res, cb) => res.pipe(bl(cb))
225228
], (err, res) => {
226-
expect(err).to.not.exist
229+
expect(err).to.not.exist()
227230
expect(res).to.be.eql(file)
228231
done()
229232
})

test/core/bootstrap.spec.js

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

4-
const expect = require('chai').expect
4+
const chai = require('chai')
5+
const dirtyChai = require('dirty-chai')
6+
const expect = chai.expect
7+
chai.use(dirtyChai)
8+
59
const isNode = require('detect-node')
610

711
// This gets replaced by require('../utils/create-repo-browser.js')
@@ -27,7 +31,7 @@ describe('bootstrap', () => {
2731
})
2832

2933
node.on('error', (err) => {
30-
expect(err).to.not.exist
34+
expect(err).to.not.exist()
3135
})
3236

3337
node.on('start', done)
@@ -62,18 +66,18 @@ describe('bootstrap', () => {
6266

6367
it('get bootstrap list', (done) => {
6468
node.bootstrap.list((err, list) => {
65-
expect(err).to.not.exist
69+
expect(err).to.not.exist()
6670
expect(list.Peers).to.deep.equal(defaultList)
6771
done()
6872
})
6973
})
7074

7175
it('add a peer to the bootstrap list', (done) => {
7276
node.bootstrap.add('/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT', (err, res) => {
73-
expect(err).to.not.exist
77+
expect(err).to.not.exist()
7478
expect(res).to.be.eql({Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT']})
7579
node.bootstrap.list((err, list) => {
76-
expect(err).to.not.exist
80+
expect(err).to.not.exist()
7781
expect(list.Peers).to.deep.equal(updatedList)
7882
done()
7983
})
@@ -82,10 +86,10 @@ describe('bootstrap', () => {
8286

8387
it('remove a peer from the bootstrap list', (done) => {
8488
node.bootstrap.rm('/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT', (err, res) => {
85-
expect(err).to.not.exist
89+
expect(err).to.not.exist()
8690
expect(res).to.be.eql({Peers: ['/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT']})
8791
node.bootstrap.list((err, list) => {
88-
expect(err).to.not.exist
92+
expect(err).to.not.exist()
8993
expect(list.Peers).to.deep.equal(defaultList)
9094
done()
9195
})

test/core/create-node.spec.js

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
/* eslint-env mocha */
33
'use strict'
44

5-
const expect = require('chai').expect
5+
const chai = require('chai')
6+
const dirtyChai = require('dirty-chai')
7+
const expect = chai.expect
8+
chai.use(dirtyChai)
9+
610
const isNode = require('detect-node')
711
const IPFS = require('../../src/core')
812

@@ -17,12 +21,12 @@ describe('create node', () => {
1721
})
1822

1923
node.on('start', (err) => {
20-
expect(err).to.not.exist
24+
expect(err).to.not.exist()
2125

2226
node.config.get((err, config) => {
23-
expect(err).to.not.exist
27+
expect(err).to.not.exist()
2428

25-
expect(config.Identity).to.exist
29+
expect(config.Identity).to.exist()
2630
node.on('stop', done)
2731
node.stop()
2832
})
@@ -35,11 +39,11 @@ describe('create node', () => {
3539
})
3640

3741
node.on('start', (err) => {
38-
expect(err).to.not.exist
42+
expect(err).to.not.exist()
3943
node.config.get((err, config) => {
40-
expect(err).to.not.exist
44+
expect(err).to.not.exist()
4145

42-
expect(config.Identity).to.exist
46+
expect(config.Identity).to.exist()
4347
node.on('stop', done)
4448
node.stop()
4549
})
@@ -52,11 +56,11 @@ describe('create node', () => {
5256
})
5357

5458
node.on('start', (err) => {
55-
expect(err).to.not.exist
59+
expect(err).to.not.exist()
5660
node.config.get((err, config) => {
57-
expect(err).to.not.exist
61+
expect(err).to.not.exist()
5862

59-
expect(config.Identity).to.exist
63+
expect(config.Identity).to.exist()
6064
// note: key length doesn't map to buffer length
6165
expect(config.Identity.PrivKey.length).is.below(2048)
6266

@@ -75,10 +79,10 @@ describe('create node', () => {
7579
})
7680

7781
node.on('start', (err) => {
78-
expect(err).to.not.exist
82+
expect(err).to.not.exist()
7983
node.config.get((err, config) => {
80-
expect(err).to.not.exist
81-
expect(config.Identity).to.exist
84+
expect(err).to.not.exist()
85+
expect(config.Identity).to.exist()
8286
expect(config.Identity.PrivKey.length).is.below(1024)
8387
node.on('stop', done)
8488
node.stop()
@@ -92,7 +96,7 @@ describe('create node', () => {
9296
init: false
9397
})
9498
node.on('error', (err) => {
95-
expect(err).to.exist
99+
expect(err).to.exist()
96100
done()
97101
})
98102
})
@@ -115,7 +119,7 @@ describe('create node', () => {
115119
node.on('stop', shouldNotHappen)
116120

117121
setTimeout(() => {
118-
expect(happened).to.be.false
122+
expect(happened).to.equal(false)
119123
done()
120124
}, 250)
121125
})
@@ -160,9 +164,9 @@ describe('create node', () => {
160164
})
161165

162166
node.on('start', (err) => {
163-
expect(err).to.not.exist
167+
expect(err).to.not.exist()
164168
node.config.get((err, config) => {
165-
expect(err).to.not.exist
169+
expect(err).to.not.exist()
166170

167171
expect(config.Addresses.Swarm).to.eql(
168172
['/ip4/127.0.0.1/tcp/9977']

0 commit comments

Comments
 (0)