2024-06-06 14:40:35 +02:00
|
|
|
/**
|
|
|
|
* @file Tests for the index file of npm package.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// The index.mjs file is generated on build before running tests
|
|
|
|
// @ts-ignore
|
2022-11-28 13:32:57 +02:00
|
|
|
import * as simpleIcons from '../index.mjs';
|
2024-03-24 19:38:18 +02:00
|
|
|
import {getIconSlug, getIconsData, slugToVariableName} from '../sdk.mjs';
|
|
|
|
import {testIcon} from './test-icon.js';
|
2021-11-06 17:03:37 +02:00
|
|
|
|
2023-08-08 06:38:52 +02:00
|
|
|
for (const icon of await getIconsData()) {
|
|
|
|
const slug = getIconSlug(icon);
|
|
|
|
const variableName = slugToVariableName(slug);
|
2024-06-06 14:40:35 +02:00
|
|
|
/** @type {import('../types.d.ts').SimpleIcon} */
|
|
|
|
// @ts-ignore
|
2023-08-08 06:38:52 +02:00
|
|
|
const subject = simpleIcons[variableName];
|
2019-07-14 21:05:38 +02:00
|
|
|
|
2023-08-08 06:38:52 +02:00
|
|
|
testIcon(icon, subject, slug);
|
|
|
|
}
|