File tree Expand file tree Collapse file tree 4 files changed +5
-18
lines changed
Expand file tree Collapse file tree 4 files changed +5
-18
lines changed Original file line number Diff line number Diff line change 55 * set up a libp2p instance for browser nodes to relay through
66 * before tests start
77 */
8- const path = require ( 'path' )
98
109const Libp2p = require ( 'libp2p' )
1110const PeerId = require ( 'peer-id' )
@@ -45,28 +44,18 @@ const before = async () => {
4544 }
4645 }
4746 } )
48-
47+
4948 await libp2p . start ( )
5049}
5150
5251const after = async ( ) => {
5352 await libp2p . stop ( )
5453}
5554
56- /** @type {import('aegir').Options["build"]["config"] } */
57- const esbuild = {
58- inject : [ path . join ( __dirname , './scripts/node-globals.js' ) ]
59- }
60-
6155/** @type {import('aegir').PartialOptions } */
6256module . exports = {
6357 test : {
6458 before,
65- after,
66- browser : {
67- config : {
68- buildConfig : esbuild
69- }
70- }
59+ after
7160 }
7261}
Original file line number Diff line number Diff line change 5858 "@typescript-eslint/parser" : " ^3.0.2" ,
5959 "aegir" : " ^36.0.2" ,
6060 "benchmark" : " ^2.1.4" ,
61- "buffer" : " ^6.0.3" ,
6261 "chai" : " ^4.2.0" ,
6362 "chai-spies" : " ^1.0.0" ,
6463 "delay" : " ^5.0.0" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11'use strict'
22/* eslint-env mocha */
33
4- const { Buffer } = require ( 'buffer' )
54const { expect } = require ( 'chai' )
65const sinon = require ( 'sinon' )
76const delay = require ( 'delay' )
7+ const { fromString : uint8ArrayFromString } = require ( 'uint8arrays/from-string' )
88
99const { GossipsubDhi } = require ( '../src/constants' )
1010const {
@@ -42,7 +42,7 @@ describe('gossip', () => {
4242 // set spy
4343 sinon . spy ( nodeA , '_pushGossip' )
4444
45- await nodeA . publish ( topic , Buffer . from ( 'hey' ) )
45+ await nodeA . publish ( topic , uint8ArrayFromString ( 'hey' ) )
4646
4747 await new Promise ( ( resolve ) => nodeA . once ( 'gossipsub:heartbeat' , resolve ) )
4848
@@ -84,7 +84,7 @@ describe('gossip', () => {
8484 const graft = { graft : [ { topicID : topic } ] }
8585 nodeA . control . set ( peerB , graft )
8686
87- await nodeA . publish ( topic , Buffer . from ( 'hey' ) )
87+ await nodeA . publish ( topic , uint8ArrayFromString ( 'hey' ) )
8888
8989 expect ( nodeA . _piggybackControl . callCount ) . to . be . equal ( 1 )
9090 // expect control message to be sent alongside published message
You can’t perform that action at this time.
0 commit comments