@@ -11,6 +11,7 @@ const { nanoid } = require('nanoid')
1111const uint8ArrayFromString = require ( 'uint8arrays/from-string' )
1212const pmap = require ( 'p-map' )
1313const multihashing = require ( 'multihashing-async' )
14+ const getIpfsOptions = require ( '../utils/ipfs-options-websockets-filter-all' )
1415
1516const makeBlock = async ( ) => {
1617 const d = uint8ArrayFromString ( `IPFS is awesome ${ nanoid ( ) } ` )
@@ -25,6 +26,7 @@ const makeBlock = async () => {
2526 * @param {Object } options
2627 */
2728module . exports = ( factory , options ) => {
29+ const ipfsOptions = getIpfsOptions ( )
2830 const describe = getDescribe ( options )
2931 const it = getIt ( options )
3032
@@ -37,7 +39,7 @@ module.exports = (factory, options) => {
3739 it ( '2 peers' , async function ( ) {
3840 // webworkers are not dialable because webrtc is not available
3941 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
4143 await local . swarm . connect ( remote . peerId . addresses [ 0 ] )
4244 const block = await makeBlock ( )
4345
@@ -51,7 +53,7 @@ module.exports = (factory, options) => {
5153 const blocks = await Promise . all ( [ ...Array ( 6 ) . keys ( ) ] . map ( ( ) => makeBlock ( ) ) )
5254 const remote1 = ( await factory . spawn ( { type : isWebWorker ? 'go' : undefined } ) ) . api
5355 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
5557 await local . swarm . connect ( remote1 . peerId . addresses [ 0 ] )
5658 await local . swarm . connect ( remote2 . peerId . addresses [ 0 ] )
5759 await remote1 . swarm . connect ( remote2 . peerId . addresses [ 0 ] )
@@ -75,7 +77,7 @@ module.exports = (factory, options) => {
7577 it ( '2 peers' , async ( ) => {
7678 const content = randomBytes ( 1024 * 1024 * 10 )
7779 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
7981 local . swarm . connect ( remote . peerId . addresses [ 0 ] )
8082
8183 const file = await remote . add ( { path : 'awesome.txt' , content } )
0 commit comments