From 3bccb6bdb53e7d164c1ced12bcc9f421b4399f6d Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 06 Oct 2022 17:30:22 +0000 Subject: [PATCH] feat: add usingPlaygrounds.atUrl, move describeXcm --- --- a/tests/src/deprecated-helpers/helpers.ts +++ b/tests/src/deprecated-helpers/helpers.ts @@ -1764,12 +1764,6 @@ return (await api.rpc.unique.collectionById(collectionId)).unwrap(); } -export const describe_xcm = ( - process.env.RUN_XCM_TESTS - ? describe - : describe.skip -); - export async function waitNewBlocks(blocksCount = 1): Promise { await usingApi(async (api) => { const promise = new Promise(async (resolve) => { --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -12,7 +12,7 @@ chai.use(chaiAsPromised); export const expect = chai.expect; -export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) => { +export async function usingPlaygrounds(code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise, url: string = config.substrateUrl) { const silentConsole = new SilentConsole(); silentConsole.enable(); @@ -28,6 +28,10 @@ await helper.disconnect(); silentConsole.disable(); } +} + +usingPlaygrounds.atUrl = (url: string, code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise) => { + return usingPlaygrounds(code, url); }; export enum Pallets { @@ -72,3 +76,9 @@ itSubIfWithPallet.only = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSubIfWithPallet(name, required, cb, {only: true}); itSubIfWithPallet.skip = (name: string, required: string[], cb: (apis: { helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair }) => any) => itSubIfWithPallet(name, required, cb, {skip: true}); itSub.ifWithPallets = itSubIfWithPallet; + +export const describeXcm = ( + process.env.RUN_XCM_TESTS + ? describe + : describe.skip +); -- gitstuff