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:
Franck Royer 2021-05-21 10:16:12 +10:00 committed by GitHub
commit f3c5a5dcec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 () {