2021-12-25 16:22:56 +02:00
|
|
|
import simpleIcons from '../index.js';
|
|
|
|
import { getIconSlug, getIconsData } from '../scripts/utils.js';
|
|
|
|
import { test, exec } from 'uvu';
|
|
|
|
import * as assert from 'uvu/assert';
|
2021-11-06 17:03:37 +02:00
|
|
|
|
2021-12-25 16:22:56 +02:00
|
|
|
(async () => {
|
|
|
|
const icons = await getIconsData();
|
2019-07-14 21:05:38 +02:00
|
|
|
|
2021-12-25 16:22:56 +02:00
|
|
|
icons.forEach((icon) => {
|
|
|
|
const slug = getIconSlug(icon);
|
|
|
|
|
|
|
|
test(`'Get' ${icon.title} by its slug`, () => {
|
|
|
|
const found = simpleIcons.Get(slug);
|
|
|
|
assert.ok(found);
|
|
|
|
assert.is(found.title, icon.title);
|
|
|
|
assert.is(found.hex, icon.hex);
|
|
|
|
assert.is(found.source, icon.source);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
test(`Iterating over simpleIcons only exposes icons`, () => {
|
|
|
|
const iconArray = Object.values(simpleIcons);
|
|
|
|
for (let icon of iconArray) {
|
|
|
|
assert.ok(icon);
|
|
|
|
assert.type(icon, 'object');
|
|
|
|
}
|
2021-05-28 12:16:50 +02:00
|
|
|
});
|
2019-07-24 21:17:46 +02:00
|
|
|
|
2021-12-25 16:22:56 +02:00
|
|
|
test.run();
|
2021-11-29 10:44:36 +02:00
|
|
|
|
2021-12-25 16:22:56 +02:00
|
|
|
exec();
|
|
|
|
})();
|