@@ -17,6 +17,7 @@ const concat = require('concat-stream')
17
17
const through = require ( 'through2' )
18
18
const path = require ( 'path' )
19
19
const bl = require ( 'bl' )
20
+ const isNode = require ( 'detect-node' )
20
21
21
22
module . exports = ( common ) => {
22
23
describe ( '.files' , function ( ) {
@@ -161,6 +162,9 @@ module.exports = (common) => {
161
162
} )
162
163
163
164
it ( 'add a nested directory as array of tupples' , ( done ) => {
165
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
166
+ if ( ! isNode ) { return done ( ) }
167
+
164
168
const content = ( name ) => ( {
165
169
path : `test-folder/${ name } ` ,
166
170
content : directory . files [ name ]
@@ -190,6 +194,9 @@ module.exports = (common) => {
190
194
} )
191
195
192
196
it ( 'add a nested directory as array of tuppled with progress' , ( done ) => {
197
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
198
+ if ( ! isNode ) { return done ( ) }
199
+
193
200
const content = ( name ) => ( {
194
201
path : `test-folder/${ name } ` ,
195
202
content : directory . files [ name ]
@@ -251,8 +258,9 @@ module.exports = (common) => {
251
258
} )
252
259
253
260
describe ( '.addReadableStream' , ( ) => {
254
- it ( 'stream of valid files and dirs' , function ( done ) {
255
- this . timeout ( 40 * 1000 )
261
+ it ( 'stream of valid files and dirs' , ( done ) => {
262
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
263
+ if ( ! isNode ) { return done ( ) }
256
264
257
265
const content = ( name ) => ( {
258
266
path : `test-folder/${ name } ` ,
@@ -291,8 +299,9 @@ module.exports = (common) => {
291
299
} )
292
300
293
301
describe ( '.addPullStream' , ( ) => {
294
- it ( 'stream of valid files and dirs' , function ( done ) {
295
- this . timeout ( 20 * 1000 )
302
+ it ( 'stream of valid files and dirs' , ( done ) => {
303
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
304
+ if ( ! isNode ) { return done ( ) }
296
305
297
306
const content = ( name ) => ( {
298
307
path : `test-folder/${ name } ` ,
@@ -495,8 +504,9 @@ module.exports = (common) => {
495
504
} )
496
505
} )
497
506
498
- it ( 'directory' , function ( done ) {
499
- this . timeout ( 40 * 1000 )
507
+ it ( 'directory' , ( done ) => {
508
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
509
+ if ( ! isNode ) { return done ( ) }
500
510
501
511
series ( [
502
512
( cb ) => {
@@ -668,8 +678,10 @@ module.exports = (common) => {
668
678
} )
669
679
670
680
describe ( '.ls' , ( ) => {
671
- before ( function ( done ) {
672
- this . timeout ( 20 * 1000 )
681
+ before ( ( done ) => {
682
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
683
+ if ( ! isNode ) { return done ( ) }
684
+
673
685
const content = ( name ) => ( {
674
686
path : `test-folder/${ name } ` ,
675
687
content : directory . files [ name ]
@@ -699,6 +711,9 @@ module.exports = (common) => {
699
711
} )
700
712
701
713
it ( 'with a base58 encoded CID' , ( done ) => {
714
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
715
+ if ( ! isNode ) { return done ( ) }
716
+
702
717
const cid = 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP'
703
718
ipfs . ls ( cid , ( err , files ) => {
704
719
expect ( err ) . to . not . exist ( )
@@ -763,8 +778,9 @@ module.exports = (common) => {
763
778
} )
764
779
765
780
describe ( '.lsReadableStream' , ( ) => {
766
- before ( function ( done ) {
767
- this . timeout ( 40 * 1000 )
781
+ before ( ( done ) => {
782
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
783
+ if ( ! isNode ) { return done ( ) }
768
784
769
785
const content = ( name ) => ( {
770
786
path : `test-folder/${ name } ` ,
@@ -795,6 +811,9 @@ module.exports = (common) => {
795
811
} )
796
812
797
813
it ( 'with a base58 encoded CID' , ( done ) => {
814
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
815
+ if ( ! isNode ) { return done ( ) }
816
+
798
817
const cid = 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP'
799
818
const stream = ipfs . lsReadableStream ( cid )
800
819
@@ -843,8 +862,10 @@ module.exports = (common) => {
843
862
} )
844
863
845
864
describe ( '.lsPullStream' , ( ) => {
846
- before ( function ( done ) {
847
- this . timeout ( 40 * 1000 )
865
+ before ( ( done ) => {
866
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
867
+ if ( ! isNode ) { return done ( ) }
868
+
848
869
const content = ( name ) => ( {
849
870
path : `test-folder/${ name } ` ,
850
871
content : directory . files [ name ]
@@ -874,6 +895,9 @@ module.exports = (common) => {
874
895
} )
875
896
876
897
it ( 'with a base58 encoded CID' , ( done ) => {
898
+ // TODO: https://github.com/ipfs/js-ipfs-api/issues/339
899
+ if ( ! isNode ) { return done ( ) }
900
+
877
901
const cid = 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP'
878
902
const stream = ipfs . lsPullStream ( cid )
879
903
0 commit comments