From a41938cf3887959b23f492ccf4f9eddb9766d60e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 14 Oct 2022 10:50:57 +0000 Subject: [PATCH] fix: disconnect on skip --- --- a/tests/src/util/playgrounds/index.ts +++ b/tests/src/util/playgrounds/index.ts @@ -71,12 +71,14 @@ AppPromotion = 'apppromotion', } -export function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) { +export async function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) { const missingPallets = helper.fetchMissingPalletNames(requiredPallets); if (missingPallets.length > 0) { const skipMsg = `\tSkipping test '${test.test?.title}'.\n\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`; console.warn('\x1b[38:5:208m%s\x1b[0m', skipMsg); + + await helper.disconnect(); test.skip(); } } @@ -86,7 +88,7 @@ opts.skip ? it.skip : it)(name, async function () { await usingPlaygrounds(async (helper, privateKey) => { if (opts.requiredPallets) { - requirePalletsOrSkip(this, helper, opts.requiredPallets); + await requirePalletsOrSkip(this, helper, opts.requiredPallets); } await cb({helper, privateKey}); -- gitstuff