difftreelog
fix warn about skipped tests
in: master
1 file changed
tests/src/util/helpers.tsdiffbeforeafterboth47 ReFungible = 'refungible',47 ReFungible = 'refungible',48 Fungible = 'fungible',48 Fungible = 'fungible',49 NFT = 'nonfungible',49 NFT = 'nonfungible',50 Scheduler = 'scheduler',50}51}515252export async function isUnique(): Promise<boolean> {53export async function isUnique(): Promise<boolean> {72 return modulesNames;73 return modulesNames;73}74}747575export function requirePallets(mocha: Context, api: ApiPromise, requiredPallets: string[]) {76export async function missingRequiredPallets(requiredPallets: string[]): Promise<string[]> {77 return await usingApi(async api => {76 const pallets = getModuleNames(api);78 const pallets = getModuleNames(api);777978 const isAllPalletsPresent = requiredPallets.every(p => pallets.includes(p));80 return requiredPallets.filter(p => !pallets.includes(p));7980 if (!isAllPalletsPresent) {81 mocha.skip();81 });82 }83}82}8384export async function checkPalletsPresence(requiredPallets: string[]): Promise<boolean> {85 return (await missingRequiredPallets(requiredPallets)).length == 0;86}8788export async function requirePallets(mocha: Context, requiredPallets: string[]) {89 const missingPallets = await missingRequiredPallets(requiredPallets);9091 if (missingPallets.length > 0) {92 const skippingTestMsg = `\tSkipping test "${mocha.test?.title}".`;93 const missingPalletsMsg = `\tThe following pallets are missing:\n\t- ${missingPallets.join('\n\t- ')}`;94 const skipMsg = `${skippingTestMsg}\n${missingPalletsMsg}`;9596 console.log('\x1b[38:5:208m%s\x1b[0m', skipMsg);9798 mocha.skip();99 }100}8410185export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId {102export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId {86 if (typeof input === 'string') {103 if (typeof input === 'string') {