difftreelog
fix disconnect on skip
in: master
1 file changed
tests/src/util/playgrounds/index.tsdiffbeforeafterboth71 AppPromotion = 'apppromotion',71 AppPromotion = 'apppromotion',72}72}737374export function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) {74export async function requirePalletsOrSkip(test: Context, helper: DevUniqueHelper, requiredPallets: string[]) {75 const missingPallets = helper.fetchMissingPalletNames(requiredPallets);75 const missingPallets = helper.fetchMissingPalletNames(requiredPallets);76 76 77 if (missingPallets.length > 0) {77 if (missingPallets.length > 0) {78 const skipMsg = `\tSkipping test '${test.test?.title}'.\n\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`;78 const skipMsg = `\tSkipping test '${test.test?.title}'.\n\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`;79 console.warn('\x1b[38:5:208m%s\x1b[0m', skipMsg);79 console.warn('\x1b[38:5:208m%s\x1b[0m', skipMsg);8081 await helper.disconnect();80 test.skip();82 test.skip();81 }83 }82}84}86 opts.skip ? it.skip : it)(name, async function () {88 opts.skip ? it.skip : it)(name, async function () {87 await usingPlaygrounds(async (helper, privateKey) => {89 await usingPlaygrounds(async (helper, privateKey) => {88 if (opts.requiredPallets) {90 if (opts.requiredPallets) {89 requirePalletsOrSkip(this, helper, opts.requiredPallets);91 await requirePalletsOrSkip(this, helper, opts.requiredPallets);90 }92 }91 93 92 await cb({helper, privateKey});94 await cb({helper, privateKey});