-
-
Notifications
You must be signed in to change notification settings - Fork 63
/
test.js
29 lines (24 loc) · 801 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* @typedef {import('./script/build-data.js').Emoji} Emoji
*/
import fs from 'node:fs/promises'
import assert from 'node:assert/strict'
import test from 'node:test'
import {gemoji} from './index.js'
/** @type {Array<Emoji>} */
const emoji = JSON.parse(String(await fs.readFile('emoji.json')))
test('gemoji', function () {
let index = -1
while (++index < gemoji.length) {
const info = gemoji[index]
assert.strictEqual(info.emoji, emoji[index].emoji, 'emoji')
assert.strictEqual(info.category, emoji[index].category, 'category')
assert.strictEqual(
info.description,
emoji[index].description,
'description'
)
assert.deepStrictEqual(info.names, emoji[index].aliases, 'names')
assert.deepStrictEqual(info.tags, emoji[index].tags, 'tags')
}
})