UNPKG

@lifi/data-types

Version:
21 lines 987 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const vitest_1 = require("vitest"); const coins_js_1 = require("./coins.js"); vitest_1.describe.concurrent('Coin logo test', { timeout: 30_000 }, () => { const allImages = []; allImages.push(...coins_js_1.defaultCoins .map((coin) => { const baseURL = coin.logoURI; const tokenSpecificURLs = Object.values(coin.chains).flatMap(({ logoURI }) => (logoURI ? [logoURI] : [])); return [baseURL, ...tokenSpecificURLs]; }) .flat()); allImages.push(...Object.values(coins_js_1.wrappedTokens).map((token) => token.logoURI)); vitest_1.test.each([...new Set(allImages)])('check that logoURI %s is valid', async (image) => { (0, vitest_1.expect)(image.startsWith('https://')).toBeTruthy(); const response = await fetch(image); (0, vitest_1.expect)(response.status).toEqual(200); }, 2000); }); //# sourceMappingURL=coins.int.spec.js.map