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 5
5
* set up a libp2p instance for browser nodes to relay through
6
6
* before tests start
7
7
*/
8
- const path = require ( 'path' )
9
8
10
9
const Libp2p = require ( 'libp2p' )
11
10
const PeerId = require ( 'peer-id' )
@@ -45,28 +44,18 @@ const before = async () => {
45
44
}
46
45
}
47
46
} )
48
-
47
+
49
48
await libp2p . start ( )
50
49
}
51
50
52
51
const after = async ( ) => {
53
52
await libp2p . stop ( )
54
53
}
55
54
56
- /** @type {import('aegir').Options["build"]["config"] } */
57
- const esbuild = {
58
- inject : [ path . join ( __dirname , './scripts/node-globals.js' ) ]
59
- }
60
-
61
55
/** @type {import('aegir').PartialOptions } */
62
56
module . exports = {
63
57
test : {
64
58
before,
65
- after,
66
- browser : {
67
- config : {
68
- buildConfig : esbuild
69
- }
70
- }
59
+ after
71
60
}
72
61
}
Original file line number Diff line number Diff line change 58
58
"@typescript-eslint/parser" : " ^3.0.2" ,
59
59
"aegir" : " ^35.0.1" ,
60
60
"benchmark" : " ^2.1.4" ,
61
- "buffer" : " ^6.0.3" ,
62
61
"chai" : " ^4.2.0" ,
63
62
"chai-spies" : " ^1.0.0" ,
64
63
"delay" : " ^5.0.0" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
/* eslint-env mocha */
3
3
4
- const { Buffer } = require ( 'buffer' )
5
4
const { expect } = require ( 'chai' )
6
5
const sinon = require ( 'sinon' )
7
6
const delay = require ( 'delay' )
7
+ const { fromString : uint8ArrayFromString } = require ( 'uint8arrays/from-string' )
8
8
9
9
const { GossipsubDhi } = require ( '../src/constants' )
10
10
const {
@@ -41,7 +41,7 @@ describe('gossip', () => {
41
41
// set spy
42
42
sinon . spy ( nodeA , '_pushGossip' )
43
43
44
- await nodeA . publish ( topic , Buffer . from ( 'hey' ) )
44
+ await nodeA . publish ( topic , uint8ArrayFromString ( 'hey' ) )
45
45
46
46
await new Promise ( ( resolve ) => nodeA . once ( 'gossipsub:heartbeat' , resolve ) )
47
47
@@ -82,7 +82,7 @@ describe('gossip', () => {
82
82
const graft = { graft : [ { topicID : topic } ] }
83
83
nodeA . control . set ( peerB , graft )
84
84
85
- await nodeA . publish ( topic , Buffer . from ( 'hey' ) )
85
+ await nodeA . publish ( topic , uint8ArrayFromString ( 'hey' ) )
86
86
87
87
expect ( nodeA . _piggybackControl . callCount ) . to . be . equal ( 1 )
88
88
// expect control message to be sent alongside published message
You can’t perform that action at this time.
0 commit comments