@@ -11,6 +11,7 @@ const { nanoid } = require('nanoid')
11
11
const uint8ArrayFromString = require ( 'uint8arrays/from-string' )
12
12
const pmap = require ( 'p-map' )
13
13
const multihashing = require ( 'multihashing-async' )
14
+ const getIpfsOptions = require ( '../utils/ipfs-options-websockets-filter-all' )
14
15
15
16
const makeBlock = async ( ) => {
16
17
const d = uint8ArrayFromString ( `IPFS is awesome ${ nanoid ( ) } ` )
@@ -25,6 +26,7 @@ const makeBlock = async () => {
25
26
* @param {Object } options
26
27
*/
27
28
module . exports = ( factory , options ) => {
29
+ const ipfsOptions = getIpfsOptions ( )
28
30
const describe = getDescribe ( options )
29
31
const it = getIt ( options )
30
32
@@ -37,7 +39,7 @@ module.exports = (factory, options) => {
37
39
it ( '2 peers' , async function ( ) {
38
40
// webworkers are not dialable because webrtc is not available
39
41
const remote = ( await factory . spawn ( { type : isWebWorker ? 'go' : undefined } ) ) . api
40
- const local = ( await factory . spawn ( ) ) . api
42
+ const local = ( await factory . spawn ( { type : 'proc' , ipfsOptions } ) ) . api
41
43
await local . swarm . connect ( remote . peerId . addresses [ 0 ] )
42
44
const block = await makeBlock ( )
43
45
@@ -51,7 +53,7 @@ module.exports = (factory, options) => {
51
53
const blocks = await Promise . all ( [ ...Array ( 6 ) . keys ( ) ] . map ( ( ) => makeBlock ( ) ) )
52
54
const remote1 = ( await factory . spawn ( { type : isWebWorker ? 'go' : undefined } ) ) . api
53
55
const remote2 = ( await factory . spawn ( { type : isWebWorker ? 'go' : undefined } ) ) . api
54
- const local = ( await factory . spawn ( ) ) . api
56
+ const local = ( await factory . spawn ( { type : 'proc' , ipfsOptions } ) ) . api
55
57
await local . swarm . connect ( remote1 . peerId . addresses [ 0 ] )
56
58
await local . swarm . connect ( remote2 . peerId . addresses [ 0 ] )
57
59
await remote1 . swarm . connect ( remote2 . peerId . addresses [ 0 ] )
@@ -75,7 +77,7 @@ module.exports = (factory, options) => {
75
77
it ( '2 peers' , async ( ) => {
76
78
const content = randomBytes ( 1024 * 1024 * 10 )
77
79
const remote = ( await factory . spawn ( { type : isWebWorker ? 'go' : undefined } ) ) . api
78
- const local = ( await factory . spawn ( ) ) . api
80
+ const local = ( await factory . spawn ( { type : 'proc' , ipfsOptions } ) ) . api
79
81
local . swarm . connect ( remote . peerId . addresses [ 0 ] )
80
82
81
83
const file = await remote . add ( { path : 'awesome.txt' , content } )
0 commit comments