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

fix: linting warnings #270

Merged
merged 1 commit into from
May 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion js/src/files-mfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const loadFixture = require('aegir/fixtures')
const expect = chai.expect
chai.use(dirtyChai)

Expand Down Expand Up @@ -477,8 +478,13 @@ module.exports = (common) => {
})
})

// TODO (achingbrain) - Not yet supported in js-ipfs or go-ipfs yet')
// TODO: (achingbrain) - Not yet supported in js-ipfs or go-ipfs yet')
describe.skip('.stat', () => {
const smallFile = {
cid: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP',
data: loadFixture('js/test/fixtures/testfile.txt', 'interface-ipfs-core')
}

before((done) => ipfs.files.add(smallFile.data, done))

it.skip('stat outside of mfs', function (done) {
Expand Down
9 changes: 2 additions & 7 deletions js/src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ module.exports = (common) => {
return loadFixture(path, 'interface-ipfs-core')
}

const wrapDirectory = {
path: 'wrapper/',
cid: 'QmbzKtHxQXJnWG9VR66TscUfcoK3CV4nceRsCdyAEsEj9A'
}

const smallFile = {
cid: 'Qma4hjFTnCasJ8PVp3mZbZK5g2vGDT4LByLJ7m8ciyRFZP',
data: fixture('js/test/fixtures/testfile.txt')
Expand Down Expand Up @@ -339,11 +334,11 @@ module.exports = (common) => {
it('files.add with only-hash=true', () => {
this.slow(10 * 1000)
const content = String(Math.random() + Date.now())

return ipfs.files.add(Buffer.from(content), { onlyHash: true })
.then(files => {
expect(files).to.have.length(1)

// 'ipfs.object.get(<hash>)' should timeout because content wasn't actually added
return expectTimeout(ipfs.object.get(files[0].hash), 4000)
})
Expand Down
1 change: 1 addition & 0 deletions js/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ exports.stats = require('./stats')
exports.repo = require('./repo')
exports.bootstrap = require('./bootstrap')
exports.types = require('./types')
exports.util = require('./util')
7 changes: 1 addition & 6 deletions js/src/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ chai.use(dirtyChai)
module.exports = (common) => {
describe('.stats', () => {
let ipfs
let withGo

before(function (done) {
// CI takes longer to instantiate the daemon, so we need to increase the
Expand All @@ -25,11 +24,7 @@ module.exports = (common) => {
factory.spawnNode((err, node) => {
expect(err).to.not.exist()
ipfs = node
node.id((err, id) => {
expect(err).to.not.exist()
withGo = id.agentVersion.startsWith('go-ipfs')
done()
})
done()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

})
})
})
Expand Down
43 changes: 22 additions & 21 deletions js/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,39 @@

const crypto = require('libp2p-crypto')
const isIPFS = require('is-ipfs')

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

describe('.types', function () {
let ipfs
module.exports = (common) => {
describe('.util', function () {
let ipfs

before(function (done) {
// CI takes longer to instantiate the daemon, so we need to increase the
// timeout for the before step
this.timeout(60 * 1000)
before(function (done) {
// CI takes longer to instantiate the daemon, so we need to increase the
// timeout for the before step
this.timeout(60 * 1000)

common.setup((err, factory) => {
expect(err).to.not.exist()
factory.spawnNode((err, node) => {
common.setup((err, factory) => {
expect(err).to.not.exist()
ipfs = node
done()
factory.spawnNode((err, node) => {
expect(err).to.not.exist()
ipfs = node
done()
})
})
})
})

after((done) => {
common.teardown(done)
})
after((done) => {
common.teardown(done)
})

it('util object', () => {
expect(ipfs.util).to.be.deep.equal({
crypto: crypto,
isIPFS: isIPFS
it('util object', () => {
expect(ipfs.util).to.be.deep.equal({
crypto: crypto,
isIPFS: isIPFS
})
})
})
})
}
1 change: 0 additions & 1 deletion js/src/utils/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

'use strict'

const Big = require('big.js')
const { expect } = require('chai')

const isBigInt = (n) => {
Expand Down