From f0a7929bf977d026d11f4f6eb090cee95ce4892f Mon Sep 17 00:00:00 2001 From: Przemek Rzad Date: Tue, 23 May 2023 13:00:43 +0200 Subject: [PATCH] Wrap the Polkadot API creation in a beforeAll (#63) --- src/tip.test.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/tip.test.ts b/src/tip.test.ts index 052a60b..245e327 100644 --- a/src/tip.test.ts +++ b/src/tip.test.ts @@ -42,15 +42,19 @@ const tipSizes: TipRequest["tip"]["size"][] = ["small", "medium", "large", new B describe("tip", () => { let state: State; + let kusamaApi: ApiPromise; + let polkadotApi: ApiPromise; - const kusamaApi = new ApiPromise({ - provider: new WsProvider(getChainConfig("localkusama").providerEndpoint), - types: { Address: "AccountId", LookupSource: "AccountId" }, - }); + beforeAll(() => { + kusamaApi = new ApiPromise({ + provider: new WsProvider(getChainConfig("localkusama").providerEndpoint), + types: { Address: "AccountId", LookupSource: "AccountId" }, + }); - const polkadotApi = new ApiPromise({ - provider: new WsProvider(getChainConfig("localpolkadot").providerEndpoint), - types: { Address: "AccountId", LookupSource: "AccountId" }, + polkadotApi = new ApiPromise({ + provider: new WsProvider(getChainConfig("localpolkadot").providerEndpoint), + types: { Address: "AccountId", LookupSource: "AccountId" }, + }); }); afterAll(async () => {