git.delta.rocks / unique-network / refs/commits / a41938cf3887

difftreelog

fix disconnect on skip

Daniel Shiposha2022-10-14parent: #9fa2d18.patch.diff
in: master

1 file changed

modifiedtests/src/util/playgrounds/index.tsdiffbeforeafterboth
71 AppPromotion = 'apppromotion',71 AppPromotion = 'apppromotion',
72}72}
7373
74export 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);
80
81 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});