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

Commit a61aade

Browse files
committed
chore: lint
1 parent cd00d5d commit a61aade

File tree

8 files changed

+15
-17
lines changed

8 files changed

+15
-17
lines changed

js/src/files/stat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ module.exports = (createCommon, options) => {
9898

9999
// TODO enable this test when this feature gets released on go-ipfs
100100
it.skip('should stat withLocal file', function (done) {
101-
ipfs.files.stat('/test/b', {withLocal: true}, (err, stat) => {
101+
ipfs.files.stat('/test/b', { withLocal: true }, (err, stat) => {
102102
expect(err).to.not.exist()
103103
expect(stat).to.eql({
104104
type: 'file',
@@ -116,7 +116,7 @@ module.exports = (createCommon, options) => {
116116

117117
// TODO enable this test when this feature gets released on go-ipfs
118118
it.skip('should stat withLocal dir', function (done) {
119-
ipfs.files.stat('/test', {withLocal: true}, (err, stat) => {
119+
ipfs.files.stat('/test', { withLocal: true }, (err, stat) => {
120120
expect(err).to.not.exist()
121121
expect(stat).to.eql({
122122
type: 'directory',

js/src/files/write.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = (createCommon, options) => {
4343
it('should write to non existent file with create flag', function (done) {
4444
const testPath = `/test-${hat()}`
4545

46-
ipfs.files.write(testPath, Buffer.from('Hello, world!'), {create: true}, (err) => {
46+
ipfs.files.write(testPath, Buffer.from('Hello, world!'), { create: true }, (err) => {
4747
expect(err).to.not.exist()
4848

4949
ipfs.files.stat(testPath, (err, stats) => {
@@ -57,7 +57,7 @@ module.exports = (createCommon, options) => {
5757
it('should write to deeply nested non existent file with create and parents flags', function (done) {
5858
const testPath = `/foo/bar/baz/test-${hat()}`
5959

60-
ipfs.files.write(testPath, Buffer.from('Hello, world!'), {create: true, parents: true}, (err) => {
60+
ipfs.files.write(testPath, Buffer.from('Hello, world!'), { create: true, parents: true }, (err) => {
6161
expect(err).to.not.exist()
6262

6363
ipfs.files.stat(testPath, (err, stats) => {

js/src/miscellaneous/dns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = (createCommon, options) => {
3434
this.timeout(20 * 1000)
3535
this.retries(3)
3636

37-
ipfs.dns('ipfs.io', {r: true}, (err, path) => {
37+
ipfs.dns('ipfs.io', { r: true }, (err, path) => {
3838
expect(err).to.not.exist()
3939
expect(path).to.exist()
4040
done()

js/src/miscellaneous/resolve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module.exports = (createCommon, options) => {
9292
it('should resolve an IPNS DNS link', function (done) {
9393
this.timeout(20 * 1000)
9494

95-
ipfs.resolve('/ipns/ipfs.io', {r: true}, (err, path) => {
95+
ipfs.resolve('/ipns/ipfs.io', { r: true }, (err, path) => {
9696
expect(err).to.not.exist()
9797
expect(isIpfs.ipfsPath(path)).to.be.true()
9898
done()

js/src/object/stat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = (createCommon, options) => {
6868
return ipfs.object.put(testObj, (err, node) => {
6969
expect(err).to.not.exist()
7070

71-
return ipfs.object.stat('QmNggDXca24S6cMPEYHZjeuc4QRmofkRrAEqVL3Ms2sdJZ', {enc: 'base58'})
71+
return ipfs.object.stat('QmNggDXca24S6cMPEYHZjeuc4QRmofkRrAEqVL3Ms2sdJZ', { enc: 'base58' })
7272
.then((stats) => {
7373
const expected = {
7474
Hash: 'QmNggDXca24S6cMPEYHZjeuc4QRmofkRrAEqVL3Ms2sdJZ',

js/src/ping/ping-pull-stream.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const pull = require('pull-stream')
55
const series = require('async/series')
66
const { spawnNodesWithId } = require('../utils/spawn')
77
const { getDescribe, getIt, expect } = require('../utils/mocha')
8-
const { expectIsPingResponse, isPong } = require('./utils')
98
const { connect } = require('../utils/swarm')
109

1110
module.exports = (createCommon, options) => {
@@ -14,7 +13,7 @@ module.exports = (createCommon, options) => {
1413
const common = createCommon()
1514

1615
describe('.pingPullStream', function () {
17-
this.timeout(30 * 1000)
16+
this.timeout(35 * 1000)
1817

1918
let ipfsA
2019
let ipfsB
@@ -49,9 +48,9 @@ module.exports = (createCommon, options) => {
4948
pull.drain((res) => {
5049
expect(res.success).to.be.true()
5150
// It's a pong
52-
if (isPong(res)) {
53-
packetNum++
54-
}
51+
// if (isPong(res)) { TODO understand why this was here, it was not defined
52+
// packetNum++
53+
// }
5554
}, (err) => {
5655
expect(err).to.not.exist()
5756
expect(packetNum).to.equal(count)

js/src/ping/ping-readable-stream.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const { Writable } = require('stream')
66
const series = require('async/series')
77
const { spawnNodesWithId } = require('../utils/spawn')
88
const { getDescribe, getIt, expect } = require('../utils/mocha')
9-
const { expectIsPingResponse, isPong } = require('./utils')
109
const { connect } = require('../utils/swarm')
1110

1211
module.exports = (createCommon, options) => {
@@ -53,9 +52,9 @@ module.exports = (createCommon, options) => {
5352
write (res, enc, cb) {
5453
expect(res.success).to.be.true()
5554
// It's a pong
56-
if (isPong(res)) {
57-
packetNum++
58-
}
55+
// if (isPong(res)) { // TODO understand why this was here, not defined before
56+
// packetNum++
57+
// }
5958

6059
cb()
6160
}

js/test/fixtures/test-folder/ipfs-add.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
const ipfs = require('../src')('localhost', 5001)
66
const files = process.argv.slice(2)
77

8-
ipfs.add(files, {recursive: true}, function (err, res) {
8+
ipfs.add(files, { recursive: true }, function (err, res) {
99
if (err || !res) return console.log(err)
1010

1111
for (let i = 0; i < res.length; i++) {

0 commit comments

Comments
 (0)