git.delta.rocks / unique-network / refs/commits / 3bccb6bdb53e

difftreelog

feat add usingPlaygrounds.atUrl, move describeXcm

Daniel Shiposha2022-10-06parent: #09b9e64.patch.diff
in: master

2 files changed

modifiedtests/src/deprecated-helpers/helpers.tsdiffbeforeafterboth
1764 return (await api.rpc.unique.collectionById(collectionId)).unwrap();1764 return (await api.rpc.unique.collectionById(collectionId)).unwrap();
1765}1765}
1766
1767export const describe_xcm = (
1768 process.env.RUN_XCM_TESTS
1769 ? describe
1770 : describe.skip
1771);
17721766
1773export async function waitNewBlocks(blocksCount = 1): Promise<void> {1767export async function waitNewBlocks(blocksCount = 1): Promise<void> {
1774 await usingApi(async (api) => {1768 await usingApi(async (api) => {
modifiedtests/src/util/playgrounds/index.tsdiffbeforeafterboth
--- 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<void>, url: string = config.substrateUrl) => {
+export async function usingPlaygrounds(code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>, 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<void>) => {
+  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
+);