From c2381385623904457627b16b69e3a4de1bc87cab Mon Sep 17 00:00:00 2001 From: Rinse Date: Sat, 2 Nov 2024 18:44:18 +0000 Subject: [PATCH] correct test to not stop the node so we can test its configs properly --- test/node-and-browser/plebbit.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/node-and-browser/plebbit.test.js b/test/node-and-browser/plebbit.test.js index 6a62ef39..8ba68c1f 100644 --- a/test/node-and-browser/plebbit.test.js +++ b/test/node-and-browser/plebbit.test.js @@ -79,15 +79,18 @@ describe("Plebbit options", async () => { }); it(`Plebbit({ipfsHttpClientOptions, httpRoutersOptions}) will change config of ipfs node`, async () => { - const onlineIpfsNode = "http://localhost:15006/api/v0"; + const nodeForHttpRouter = "http://localhost:15006/api/v0"; // default list of http routers to use const httpRouterUrls = ["https://routing.lol", "https://peers.pleb.bot"]; - const plebbit = await Plebbit({ ipfsHttpClientsOptions: [onlineIpfsNode], httpRoutersOptions: httpRouterUrls }); + const plebbit = await Plebbit({ ipfsHttpClientsOptions: [nodeForHttpRouter], httpRoutersOptions: httpRouterUrls }); + + plebbit.clients.ipfsClients[nodeForHttpRouter]._client.stop = () => {}; expect(plebbit.httpRoutersOptions).to.deep.equal(httpRouterUrls); await new Promise((resolve) => setTimeout(resolve, 2000)); - const ipfsClient = plebbit.clients.ipfsClients[onlineIpfsNode]._client; + + const ipfsClient = plebbit.clients.ipfsClients[nodeForHttpRouter]._client; const configValueType = await ipfsClient.config.get("Routing.Type"); expect(configValueType).to.equal("custom");