Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit aae31b0

Browse files
committed
fix: linting warnings
License: MIT Signed-off-by: Alan Shaw <alan@tableflip.io>
1 parent d3986c0 commit aae31b0

File tree

6 files changed

+33
-36
lines changed

6 files changed

+33
-36
lines changed

Diff for: js/src/files-mfs.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
const chai = require('chai')
77
const dirtyChai = require('dirty-chai')
8+
const loadFixture = require('aegir/fixtures')
89
const expect = chai.expect
910
chai.use(dirtyChai)
1011

@@ -477,8 +478,13 @@ module.exports = (common) => {
477478
})
478479
})
479480

480-
// TODO (achingbrain) - Not yet supported in js-ipfs or go-ipfs yet')
481+
// TODO: (achingbrain) - Not yet supported in js-ipfs or go-ipfs yet')
481482
describe.skip('.stat', () => {
483+
const smallFile = {
484+
cid: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP',
485+
data: loadFixture('js/test/fixtures/testfile.txt', 'interface-ipfs-core')
486+
}
487+
482488
before((done) => ipfs.files.add(smallFile.data, done))
483489

484490
it.skip('stat outside of mfs', function (done) {

Diff for: js/src/files.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ module.exports = (common) => {
3232
return loadFixture(path, 'interface-ipfs-core')
3333
}
3434

35-
const wrapDirectory = {
36-
path: 'wrapper/',
37-
cid: 'QmbzKtHxQXJnWG9VR66TscUfcoK3CV4nceRsCdyAEsEj9A'
38-
}
39-
4035
const smallFile = {
4136
cid: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP',
4237
data: fixture('js/test/fixtures/testfile.txt')
@@ -339,11 +334,11 @@ module.exports = (common) => {
339334
it('files.add with only-hash=true', () => {
340335
this.slow(10 * 1000)
341336
const content = String(Math.random() + Date.now())
342-
337+
343338
return ipfs.files.add(Buffer.from(content), { onlyHash: true })
344339
.then(files => {
345340
expect(files).to.have.length(1)
346-
341+
347342
// 'ipfs.object.get(<hash>)' should timeout because content wasn't actually added
348343
return expectTimeout(ipfs.object.get(files[0].hash), 4000)
349344
})

Diff for: js/src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ exports.stats = require('./stats')
1717
exports.repo = require('./repo')
1818
exports.bootstrap = require('./bootstrap')
1919
exports.types = require('./types')
20+
exports.util = require('./util')

Diff for: js/src/stats.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ chai.use(dirtyChai)
1313
module.exports = (common) => {
1414
describe('.stats', () => {
1515
let ipfs
16-
let withGo
1716

1817
before(function (done) {
1918
// CI takes longer to instantiate the daemon, so we need to increase the
@@ -25,11 +24,7 @@ module.exports = (common) => {
2524
factory.spawnNode((err, node) => {
2625
expect(err).to.not.exist()
2726
ipfs = node
28-
node.id((err, id) => {
29-
expect(err).to.not.exist()
30-
withGo = id.agentVersion.startsWith('go-ipfs')
31-
done()
32-
})
27+
done()
3328
})
3429
})
3530
})

Diff for: js/src/util.js

+22-21
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,39 @@
33

44
const crypto = require('libp2p-crypto')
55
const isIPFS = require('is-ipfs')
6-
76
const chai = require('chai')
87
const dirtyChai = require('dirty-chai')
98
const expect = chai.expect
109
chai.use(dirtyChai)
1110

12-
describe('.types', function () {
13-
let ipfs
11+
module.exports = (common) => {
12+
describe('.util', function () {
13+
let ipfs
1414

15-
before(function (done) {
16-
// CI takes longer to instantiate the daemon, so we need to increase the
17-
// timeout for the before step
18-
this.timeout(60 * 1000)
15+
before(function (done) {
16+
// CI takes longer to instantiate the daemon, so we need to increase the
17+
// timeout for the before step
18+
this.timeout(60 * 1000)
1919

20-
common.setup((err, factory) => {
21-
expect(err).to.not.exist()
22-
factory.spawnNode((err, node) => {
20+
common.setup((err, factory) => {
2321
expect(err).to.not.exist()
24-
ipfs = node
25-
done()
22+
factory.spawnNode((err, node) => {
23+
expect(err).to.not.exist()
24+
ipfs = node
25+
done()
26+
})
2627
})
2728
})
28-
})
2929

30-
after((done) => {
31-
common.teardown(done)
32-
})
30+
after((done) => {
31+
common.teardown(done)
32+
})
3333

34-
it('util object', () => {
35-
expect(ipfs.util).to.be.deep.equal({
36-
crypto: crypto,
37-
isIPFS: isIPFS
34+
it('util object', () => {
35+
expect(ipfs.util).to.be.deep.equal({
36+
crypto: crypto,
37+
isIPFS: isIPFS
38+
})
3839
})
3940
})
40-
})
41+
}

Diff for: js/src/utils/stats.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
'use strict'
55

6-
const Big = require('big.js')
76
const { expect } = require('chai')
87

98
const isBigInt = (n) => {

0 commit comments

Comments
 (0)