1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-12-16 01:10:30 +02:00
simple-icons/tests/index.test.js

20 lines
574 B
JavaScript
Raw Normal View History

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
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';
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
const subject = simpleIcons[variableName];
testIcon(icon, subject, slug);
}