This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 4 files changed +17
-21
lines changed
4 files changed +17
-21
lines changed Original file line number Diff line number Diff line change 36
36
},
37
37
"homepage" : " https://github.com/ipfs/interface-ipfs-core#readme" ,
38
38
"dependencies" : {
39
- "async" : " ^2.6.2" ,
40
39
"bs58" : " ^4.0.1" ,
41
40
"chai" : " ^4.2.0" ,
42
41
"chai-as-promised" : " ^7.1.1" ,
43
42
"cids" : " ~0.7.1" ,
44
- "concat-stream" : " ^2.0.0" ,
45
43
"delay" : " ^4.3.0" ,
46
44
"dirty-chai" : " ^2.0.1" ,
47
45
"es6-promisify" : " ^6.0.2" ,
Original file line number Diff line number Diff line change @@ -28,22 +28,20 @@ module.exports = (common, options) => {
28
28
let pbNode
29
29
let cborNode
30
30
31
- before ( ( ) => {
31
+ before ( ( done ) => {
32
32
const someData = Buffer . from ( 'some data' )
33
33
34
- return new Promise ( ( resolve , reject ) => {
35
- try {
36
- pbNode = new DAGNode ( someData )
37
- } catch ( err ) {
38
- return reject ( err )
39
- }
34
+ try {
35
+ pbNode = new DAGNode ( someData )
36
+ } catch ( err ) {
37
+ return done ( err )
38
+ }
40
39
41
- cborNode = {
42
- data : someData
43
- }
40
+ cborNode = {
41
+ data : someData
42
+ }
44
43
45
- resolve ( )
46
- } )
44
+ done ( )
47
45
} )
48
46
49
47
it ( 'should put dag-pb with default hash func (sha2-256)' , ( ) => {
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const { fixtures } = require ( './utils' )
5
- const concat = require ( 'concat-stream' )
6
5
const through = require ( 'through2' )
7
6
const { getDescribe, getIt, expect } = require ( '../utils/mocha' )
7
+ const getStream = require ( 'get-stream' )
8
8
9
9
/** @typedef { import("ipfsd-ctl").TestsInterface } TestsInterface */
10
10
/**
@@ -35,11 +35,10 @@ module.exports = (common, options) => {
35
35
// to 'pump' module that get-stream uses
36
36
const files = await new Promise ( ( resolve , reject ) => {
37
37
const filesArr = [ ]
38
- stream . pipe ( through . obj ( ( file , enc , next ) => {
39
- file . content . pipe ( concat ( ( content ) => {
40
- filesArr . push ( { path : file . path , content : content } )
41
- next ( )
42
- } ) )
38
+ stream . pipe ( through . obj ( async ( file , enc , next ) => {
39
+ const content = await getStream . buffer ( file . content )
40
+ filesArr . push ( { path : file . path , content : content } )
41
+ next ( )
43
42
} , ( ) => resolve ( filesArr ) ) )
44
43
} )
45
44
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ module.exports = (common, options) => {
25
25
ipfsA = await common . setup ( )
26
26
ipfsB = await common . setup ( )
27
27
await ipfsA . swarm . connect ( ipfsB . peerId . addresses [ 0 ] )
28
+ await delay ( 60 * 1000 ) // wait for open streams in the connection available
28
29
} )
29
30
30
31
after ( ( ) => common . teardown ( ) )
@@ -53,7 +54,7 @@ module.exports = (common, options) => {
53
54
expect ( multiaddr . isMultiaddr ( peer . addr ) ) . to . equal ( true )
54
55
expect ( peer ) . to . have . a . property ( 'peer' )
55
56
expect ( peer ) . to . have . a . property ( 'latency' )
56
- expect ( peer . latency ) . to . match ( / n \/ a | [ 0 - 9 ] + m ? s / ) // n/a or 3ms or 3s
57
+ expect ( peer . latency ) . to . match ( / n \/ a | [ 0 - 9 ] + [ m µ ] ? s / ) // n/a or 3ms or 3µs or 3s
57
58
expect ( peer ) . to . have . a . property ( 'muxer' )
58
59
expect ( peer ) . to . have . a . property ( 'streams' )
59
60
} )
You can’t perform that action at this time.
0 commit comments