mirror of
https://github.com/Mibew/simple-icons.git
synced 2025-01-09 03:31:11 +03:00
a14e03cf7a
* switch from jest to uvu * remove jest config * convert index.test.js to uvu * use assert.type * Get rid of jest-diff * Remove uneeded splits * remove out.txt * switch to fake-diff
28 lines
746 B
JavaScript
28 lines
746 B
JavaScript
const { icons } = require('../_data/simple-icons.json');
|
|
const simpleIcons = require('../index.js');
|
|
const { getIconSlug } = require('../scripts/utils');
|
|
const { test } = require('uvu');
|
|
const assert = require('uvu/assert');
|
|
|
|
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');
|
|
}
|
|
});
|
|
|
|
test.run();
|