-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
emoji_test.ts
58 lines (53 loc) · 1.23 KB
/
emoji_test.ts
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { assertEquals } from "https://deno.land/[email protected]/assert/assert_equals.ts";
import * as emj from "./emoji.ts";
Deno.test({
name: "emoji | get",
fn(): void {
for (const emoji of emj.all()) {
for (const alias of emoji.aliases) {
const one = emj.get(alias);
assertEquals(one, emoji.emoji);
const two = emj.get(`:${alias}:`);
assertEquals(two, emoji.emoji);
}
}
},
});
Deno.test({
name: "emoji | alias",
fn(): void {
for (const emoji of emj.all()) {
const alias = emj.alias(emoji.emoji);
assertEquals(alias, emoji.aliases[0]);
}
},
});
Deno.test({
name: "emoji | aliases",
fn(): void {
for (const emoji of emj.all()) {
const aliases = emj.aliases(emoji.emoji);
assertEquals(aliases, emoji.aliases);
}
},
});
Deno.test({
name: "emoji | infoByAlias",
fn(): void {
for (const emoji of emj.all()) {
for (const alias of emoji.aliases) {
const info = emj.infoByAlias(alias);
assertEquals(info, emoji);
}
}
},
});
Deno.test({
name: "emoji | infoByCode",
fn(): void {
for (const emoji of emj.all()) {
const info = emj.infoByCode(emoji.emoji);
assertEquals(info, emoji);
}
},
});