Skip to content

Commit

Permalink
fix: update tests to work with the RemoteBlocks abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-pousette committed Dec 5, 2023
1 parent 0c460c3 commit fba99b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ describe("client", () => {
directory: "./tmp/server-node/client/" + new Date(),
listenPort: 9123
});
expect(client.services.blocks["_localStore"]).toBeInstanceOf(AnyBlockStore);
expect(client.services.blocks["remoteBlocks"].localStore).toBeInstanceOf(
AnyBlockStore
);
expect(client.services.blocks["canRelayMessage"]).toEqual(true);
expect(client.services.pubsub["canRelayMessage"]).toEqual(true);
expect(client.services["relay"]).toBeDefined();
Expand Down
3 changes: 2 additions & 1 deletion packages/clients/peerbit/src/__tests__/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ describe("Create", function () {

it("block storage exist at path", async () => {
const location = (
client.libp2p.services.blocks["_localStore"] as AnyBlockStore
client.libp2p.services.blocks["remoteBlocks"]
.localStore as AnyBlockStore
)["_store"].store["location"];
expect(location).toEndWith(
path.join(client.directory!, "blocks").toString()
Expand Down
8 changes: 4 additions & 4 deletions packages/clients/peerbit/src/__tests__/dial.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ describe(`dial`, function () {
expect(data && new Uint8Array(data)).toEqual(new Uint8Array([1]));
});

it("autodials by default", async () => {
it("dialer settings", async () => {
expect(
clients[0].services.pubsub.connectionManagerOptions.dialer
).toBeDefined();
expect(
clients[1].services.blocks.connectionManagerOptions.dialer
).toBeDefined();
).toBeUndefined();
});

it("autoprunes by default", async () => {
it("prune settings", async () => {
expect(
clients[0].services.pubsub.connectionManagerOptions.pruner
).toBeDefined();
expect(
clients[1].services.blocks.connectionManagerOptions.pruner
).toBeDefined();
).toBeUndefined();
});
});

0 comments on commit fba99b6

Please sign in to comment.