mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-01-21 01:13:15 +00:00
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import { expect } from "chai";
|
|
import PeerId from "peer-id";
|
|
|
|
import { Waku } from "./waku";
|
|
|
|
declare global {
|
|
interface Window {
|
|
__env__?: any;
|
|
}
|
|
}
|
|
declare let window: Window | undefined;
|
|
|
|
describe("Waku Dial", function () {
|
|
describe("Bootstrap [live data]", function () {
|
|
let waku: Waku;
|
|
|
|
afterEach(function () {
|
|
!!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e));
|
|
});
|
|
|
|
before(function () {
|
|
if (process.env.CI || window?.__env__?.CI) {
|
|
this.skip();
|
|
}
|
|
});
|
|
|
|
it("Enabling default [live data]", async function () {
|
|
// This test depends on fleets.status.im being online.
|
|
// This dependence must be removed once DNS discovery is implemented
|
|
this.timeout(20_000);
|
|
|
|
waku = await Waku.create({
|
|
bootstrap: { default: true },
|
|
});
|
|
|
|
const connectedPeerID: PeerId = await new Promise((resolve) => {
|
|
waku.libp2p.connectionManager.on("peer:connect", (connection) => {
|
|
resolve(connection.remotePeer);
|
|
});
|
|
});
|
|
|
|
expect(connectedPeerID).to.not.be.undefined;
|
|
});
|
|
});
|
|
});
|