Skip to content

Commit 86fc176

Browse files
committed
feat: add presets for emoji test
1 parent 02a2c30 commit 86fc176

File tree

1 file changed

+152
-1
lines changed

1 file changed

+152
-1
lines changed

src/generators/emoji-test.ts

Lines changed: 152 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ const emojiTestOptionsSchema = z.object({
2626
version: z.string(),
2727
});
2828

29-
export const emojiTest = createLoom({
29+
const baseEmojiTest = createLoom({
3030
inputSchema: emojiTestInputSchema,
3131
optionsSchema: emojiTestOptionsSchema,
3232
predicate: (ctx) => {
33+
// files for versions 3.x and under doesn't exist.
3334
return ctx.isVersionGreaterThanOrEqual("3.x");
3435
},
3536
eof: true,
@@ -47,3 +48,153 @@ export const emojiTest = createLoom({
4748
return template;
4849
},
4950
});
51+
52+
export const emojiTest = Object.assign(baseEmojiTest, {
53+
smileys: (version: string): string => {
54+
return baseEmojiTest({
55+
version,
56+
separator: ";",
57+
commentPrefix: "#",
58+
input: [
59+
{
60+
group: "Smileys & Emotion",
61+
subgroups: [
62+
{
63+
subgroup: "face-smiling",
64+
entries: [
65+
{
66+
codePoints: ["1F600"],
67+
status: "fully-qualified",
68+
comment: "grinning face",
69+
},
70+
{
71+
codePoints: ["1F603"],
72+
status: "fully-qualified",
73+
comment: "grinning face with big eyes",
74+
},
75+
{
76+
codePoints: ["1F604"],
77+
status: "fully-qualified",
78+
comment: "grinning face with smiling eyes",
79+
},
80+
],
81+
},
82+
],
83+
},
84+
],
85+
});
86+
},
87+
skinTone: (version: string): string => {
88+
return baseEmojiTest({
89+
version,
90+
separator: ";",
91+
commentPrefix: "#",
92+
input: [
93+
{
94+
group: "Component",
95+
subgroups: [
96+
{
97+
subgroup: "skin-tone",
98+
entries: [
99+
{
100+
codePoints: ["1F3FB"],
101+
status: "component",
102+
comment: "light skin tone",
103+
},
104+
{
105+
codePoints: ["1F3FC"],
106+
status: "component",
107+
comment: "medium-light skin tone",
108+
},
109+
{
110+
codePoints: ["1F3FD"],
111+
status: "component",
112+
comment: "medium skin tone",
113+
},
114+
{
115+
codePoints: ["1F3FE"],
116+
status: "component",
117+
comment: "medium-dark skin tone",
118+
},
119+
{
120+
codePoints: ["1F3FF"],
121+
status: "component",
122+
comment: "dark skin tone",
123+
},
124+
],
125+
},
126+
],
127+
},
128+
],
129+
});
130+
},
131+
family: (version: string): string => {
132+
return baseEmojiTest({
133+
version,
134+
separator: ";",
135+
commentPrefix: "#",
136+
input: [
137+
{
138+
group: "People & Body",
139+
subgroups: [
140+
{
141+
subgroup: "family",
142+
entries: [
143+
{
144+
codePoints: ["1F468", "200D", "1F469", "200D", "1F467"],
145+
status: "fully-qualified",
146+
comment: "family: man, woman, girl",
147+
},
148+
{
149+
codePoints: ["1F468", "200D", "1F469", "200D", "1F467", "200D", "1F466"],
150+
status: "fully-qualified",
151+
comment: "family: man, woman, girl, boy",
152+
},
153+
{
154+
codePoints: ["1F468", "200D", "1F469", "200D", "1F466", "200D", "1F466"],
155+
status: "fully-qualified",
156+
comment: "family: man, woman, boy, boy",
157+
},
158+
],
159+
},
160+
],
161+
},
162+
],
163+
});
164+
},
165+
166+
flag: (version: string): string => {
167+
return baseEmojiTest({
168+
version,
169+
separator: ";",
170+
commentPrefix: "#",
171+
input: [
172+
{
173+
group: "Flags",
174+
subgroups: [
175+
{
176+
subgroup: "country-flag",
177+
entries: [
178+
{
179+
codePoints: ["1F1E6", "1F1E8"],
180+
status: "fully-qualified",
181+
comment: "flag: Argentina",
182+
},
183+
{
184+
codePoints: ["1F1E6", "1F1F4"],
185+
status: "fully-qualified",
186+
comment: "flag: Angola",
187+
},
188+
{
189+
codePoints: ["1F1E6", "1F1F6"],
190+
status: "fully-qualified",
191+
comment: "flag: Antarctica",
192+
},
193+
],
194+
},
195+
],
196+
},
197+
],
198+
});
199+
},
200+
});

0 commit comments

Comments
 (0)