mirror of
https://github.com/waku-org/js-waku.git
synced 2025-01-28 05:05:34 +00:00
Merge pull request #173 from status-im/do-not-start-unnecessary-nodes
Ensure that no unnecessary js node are started for interop tests
This commit is contained in:
commit
f3c5a5dcec
@ -17,6 +17,7 @@ import { DefaultPubsubTopic, RelayCodec } from './index';
|
||||
const log = debug('waku:test');
|
||||
|
||||
describe('Waku Relay', () => {
|
||||
describe('js only', () => {
|
||||
afterEach(function () {
|
||||
if (this.currentTest?.state === 'failed') {
|
||||
console.log(`Test failed, log file name is ${makeLogFileName(this)}`);
|
||||
@ -57,8 +58,12 @@ describe('Waku Relay', () => {
|
||||
});
|
||||
|
||||
it('Subscribe', async function () {
|
||||
const subscribers1 = waku1.libp2p.pubsub.getSubscribers(DefaultPubsubTopic);
|
||||
const subscribers2 = waku2.libp2p.pubsub.getSubscribers(DefaultPubsubTopic);
|
||||
const subscribers1 = waku1.libp2p.pubsub.getSubscribers(
|
||||
DefaultPubsubTopic
|
||||
);
|
||||
const subscribers2 = waku2.libp2p.pubsub.getSubscribers(
|
||||
DefaultPubsubTopic
|
||||
);
|
||||
|
||||
expect(subscribers1).to.contain(waku2.libp2p.peerId.toB58String());
|
||||
expect(subscribers2).to.contain(waku1.libp2p.peerId.toB58String());
|
||||
@ -77,9 +82,11 @@ describe('Waku Relay', () => {
|
||||
const messageText = 'JS to JS communication works';
|
||||
const message = WakuMessage.fromUtf8String(messageText);
|
||||
|
||||
const receivedMsgPromise: Promise<WakuMessage> = new Promise((resolve) => {
|
||||
const receivedMsgPromise: Promise<WakuMessage> = new Promise(
|
||||
(resolve) => {
|
||||
waku2.relay.addObserver(resolve);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
await waku1.relay.send(message);
|
||||
|
||||
@ -125,6 +132,7 @@ describe('Waku Relay', () => {
|
||||
expect(allMessages[1].version).to.eq(barMessage.version);
|
||||
expect(allMessages[1].payloadAsUtf8).to.eq(barMessageText);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Interop: Nim', function () {
|
||||
describe('Nim connects to js', function () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user