File tree 2 files changed +19
-16
lines changed
2 files changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,12 @@ import chai, { expect } from "chai";
17
17
import chaiAsPromised from "chai-as-promised" ;
18
18
import sinon from "sinon" ;
19
19
20
- import { delay , makeLogFileName , NOISE_KEY_1 } from "../src/index.js" ;
20
+ import {
21
+ delay ,
22
+ makeLogFileName ,
23
+ NOISE_KEY_1 ,
24
+ tearDownNodes
25
+ } from "../src/index.js" ;
21
26
import { NimGoNode } from "../src/node/node.js" ;
22
27
23
28
chai . use ( chaiAsPromised ) ;
@@ -43,13 +48,9 @@ describe("Util: toAsyncIterator: Filter", () => {
43
48
await waitForRemotePeer ( waku , [ Protocols . Filter , Protocols . LightPush ] ) ;
44
49
} ) ;
45
50
46
- afterEach ( async ( ) => {
47
- try {
48
- await nwaku . stop ( ) ;
49
- await waku . stop ( ) ;
50
- } catch ( err ) {
51
- console . log ( "Failed to stop" , err ) ;
52
- }
51
+ afterEach ( async function ( ) {
52
+ this . timeout ( 10000 ) ;
53
+ await tearDownNodes ( nwaku , waku ) ;
53
54
} ) ;
54
55
55
56
it ( "creates an iterator" , async function ( ) {
@@ -99,6 +100,8 @@ describe("Util: toAsyncIterator: Filter", () => {
99
100
payload : utf8ToBytes ( "This should be received" )
100
101
} ) ;
101
102
103
+ await delay ( 400 ) ;
104
+
102
105
await stop ( ) ;
103
106
104
107
await waku . lightPush . send ( TestEncoder , {
Original file line number Diff line number Diff line change @@ -22,24 +22,24 @@ import { expect } from "chai";
22
22
23
23
import {
24
24
makeLogFileName ,
25
- NimGoNode ,
26
25
NOISE_KEY_1 ,
27
- NOISE_KEY_2
26
+ NOISE_KEY_2 ,
27
+ tearDownNodes
28
28
} from "../src/index.js" ;
29
+ import { NimGoNode } from "../src/node/node.js" ;
29
30
30
31
const TestContentTopic = "/test/1/waku/utf8" ;
31
32
32
33
const TestEncoder = createPlainEncoder ( { contentTopic : TestContentTopic } ) ;
33
34
34
35
describe ( "Waku Dial [node only]" , function ( ) {
35
36
describe ( "Interop: NimGoNode" , function ( ) {
36
- let waku : Waku ;
37
+ let waku : LightNode ;
37
38
let nwaku : NimGoNode ;
38
39
39
40
afterEach ( async function ( ) {
40
- ! ! nwaku &&
41
- nwaku . stop ( ) . catch ( ( e ) => console . log ( "Nwaku failed to stop" , e ) ) ;
42
- ! ! waku && waku . stop ( ) . catch ( ( e ) => console . log ( "Waku failed to stop" , e ) ) ;
41
+ this . timeout ( 15000 ) ;
42
+ await tearDownNodes ( nwaku , waku ) ;
43
43
} ) ;
44
44
45
45
it ( "connects to nwaku" , async function ( ) {
@@ -102,8 +102,8 @@ describe("Waku Dial [node only]", function () {
102
102
let nwaku : NimGoNode ;
103
103
104
104
afterEach ( async function ( ) {
105
- ! ! nwaku && ( await nwaku . stop ( ) ) ;
106
- ! ! waku && waku . stop ( ) . catch ( ( e ) => console . log ( "Waku failed to stop" , e ) ) ;
105
+ this . timeout ( 15000 ) ;
106
+ await tearDownNodes ( nwaku , waku ) ;
107
107
} ) ;
108
108
109
109
it ( "Passing an array" , async function ( ) {
You can’t perform that action at this time.
0 commit comments