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

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JonKrone committed Feb 22, 2018
1 parent 551db2c commit 85024ac
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/cli/commands/files/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module.exports = {
alias: 'n',
type: 'boolean',
default: false,
describe: 'Only chunk and hash, do not write to disk'
describe: 'Only chunk and hash, do not write'
},
'enable-sharding-experiment': {
type: 'boolean',
Expand Down
2 changes: 1 addition & 1 deletion src/http/api/resources/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ exports.add = {
'cid-version': request.query['cid-version'],
'raw-leaves': request.query['raw-leaves'],
progress: request.query.progress ? progressHandler : null,
onlyHash: !!request.query['only-hash']
onlyHash: Boolean(request.query['only-hash'])
}

const aborter = abortable()
Expand Down
11 changes: 7 additions & 4 deletions test/cli/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,14 @@ describe('files', () => runOnAndOff((thing) => {
fs.writeFileSync(filepath, content)

return ipfs(`files add --only-hash ${filepath}`)
.then(hash => {
const speculativeHash = hash.split(' ')[1]
.then(out => {
const hash = out.split(' ')[1]

// 'jsipfs object get <hash>' should time out with the daemon on
// and should fail fast with the daemon off
return Promise.race([
ipfs.fail(`object get ${speculativeHash}`),
new Promise(res => setTimeout(res, 5000))
ipfs.fail(`object get ${hash}`),
new Promise((resolve, reject) => setTimeout(resolve, 4000))
])
.then(() => fs.unlinkSync(filepath))
})
Expand Down
4 changes: 2 additions & 2 deletions test/http-api/extra/files.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-env mocha */
/* eslint max-nested-callbacks: ["error", 8] */
'use strict'

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

module.exports = ctl => {
Expand All @@ -22,7 +22,7 @@ module.exports = ctl => {

return Promise.race([
getAttempt,
new Promise(res => setTimeout(res, 4000))
new Promise((resolve, reject) => setTimeout(resolve, 4000))
])
})
})
Expand Down
4 changes: 2 additions & 2 deletions test/http-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const path = require('path')
const clean = require('../utils/clean')

describe('HTTP API', () => {
const repoExample = path.join(__dirname, '..', 'fixtures', 'go-ipfs-repo')
const repoTests = path.join(__dirname, '..', 'repo-tests-run')
const repoExample = path.join(__dirname, '../fixtures/go-ipfs-repo')
const repoTests = path.join(__dirname, '../repo-tests-run')
const http = {}

before(function (done) {
Expand Down

0 comments on commit 85024ac

Please sign in to comment.