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

Commit

Permalink
fix: linting warnings
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw committed May 15, 2018
1 parent d3986c0 commit aae31b0
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 36 deletions.
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()
})
})
})
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

0 comments on commit aae31b0

Please sign in to comment.