Skip to content

Commit

Permalink
test(stub): make sure plebbit.listSubplebbits() is stubbed so we don'…
Browse files Browse the repository at this point in the history
…t call the rpc in tests
  • Loading branch information
Rinse12 committed Dec 9, 2023
1 parent ec81168 commit e373887
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/cli/base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ export abstract class BaseCommand extends Command {
})
};


_connectToPlebbitRpc = async (plebbitRpcApiUrl: string) => {
const plebbit = await Plebbit({ plebbitRpcClientsOptions: [plebbitRpcApiUrl] });
await plebbit.listSubplebbits(); // To make sure we're connected
return plebbit;

}
};
}
2 changes: 2 additions & 0 deletions test/cli/root-hook-mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ exports.mochaHooks = {

Sinon.stub(PlebbitRpcClient.prototype, "_init");
Sinon.stub(PlebbitRpcClient.prototype, "destroy")

Sinon.stub(Plebbit.prototype, "listSubplebbits");
},
beforeEach: () => {},
afterAll: () => {},
Expand Down

0 comments on commit e373887

Please sign in to comment.