This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 5 files changed +13
-10
lines changed 5 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ module.exports = {
143
143
alias : 'n' ,
144
144
type : 'boolean' ,
145
145
default : false ,
146
- describe : 'Only chunk and hash, do not write to disk '
146
+ describe : 'Only chunk and hash, do not write'
147
147
} ,
148
148
'enable-sharding-experiment' : {
149
149
type : 'boolean' ,
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ exports.add = {
207
207
'cid-version' : request . query [ 'cid-version' ] ,
208
208
'raw-leaves' : request . query [ 'raw-leaves' ] ,
209
209
progress : request . query . progress ? progressHandler : null ,
210
- onlyHash : ! ! request . query [ 'only-hash' ]
210
+ onlyHash : Boolean ( request . query [ 'only-hash' ] )
211
211
}
212
212
213
213
const aborter = abortable ( )
Original file line number Diff line number Diff line change @@ -287,11 +287,14 @@ describe('files', () => runOnAndOff((thing) => {
287
287
fs . writeFileSync ( filepath , content )
288
288
289
289
return ipfs ( `files add --only-hash ${ filepath } ` )
290
- . then ( hash => {
291
- const speculativeHash = hash . split ( ' ' ) [ 1 ]
290
+ . then ( out => {
291
+ const hash = out . split ( ' ' ) [ 1 ]
292
+
293
+ // 'jsipfs object get <hash>' should time out with the daemon on
294
+ // and should fail fast with the daemon off
292
295
return Promise . race ( [
293
- ipfs . fail ( `object get ${ speculativeHash } ` ) ,
294
- new Promise ( res => setTimeout ( res , 5000 ) )
296
+ ipfs . fail ( `object get ${ hash } ` ) ,
297
+ new Promise ( ( resolve , reject ) => setTimeout ( resolve , 4000 ) )
295
298
] )
296
299
. then ( ( ) => fs . unlinkSync ( filepath ) )
297
300
} )
Original file line number Diff line number Diff line change 1
1
/* eslint-env mocha */
2
+ /* eslint max-nested-callbacks: ["error", 8] */
2
3
'use strict'
3
4
4
5
const chai = require ( 'chai' )
5
6
const dirtyChai = require ( 'dirty-chai' )
6
- const expect = chai . expect
7
7
chai . use ( dirtyChai )
8
8
9
9
module . exports = ctl => {
@@ -22,7 +22,7 @@ module.exports = ctl => {
22
22
23
23
return Promise . race ( [
24
24
getAttempt ,
25
- new Promise ( res => setTimeout ( res , 4000 ) )
25
+ new Promise ( ( resolve , reject ) => setTimeout ( resolve , 4000 ) )
26
26
] )
27
27
} )
28
28
} )
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ const path = require('path')
14
14
const clean = require ( '../utils/clean' )
15
15
16
16
describe ( 'HTTP API' , ( ) => {
17
- const repoExample = path . join ( __dirname , '..' , ' fixtures' , ' go-ipfs-repo')
18
- const repoTests = path . join ( __dirname , '..' , ' repo-tests-run')
17
+ const repoExample = path . join ( __dirname , '../ fixtures/ go-ipfs-repo' )
18
+ const repoTests = path . join ( __dirname , '../ repo-tests-run' )
19
19
const http = { }
20
20
21
21
before ( function ( done ) {
You can’t perform that action at this time.
0 commit comments