This repository has been archived by the owner on Feb 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
/
index.test.js
97 lines (73 loc) · 2.87 KB
/
index.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
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import { hiMom } from "./index";
test("should say hi to mom", () => {
expect(hiMom()).toBe("Hi, mom!");
});
test("should not say hi to dad", () => {
expect(hiMom()).not.toBe("Hi, dad!");
});
test("should say hi to Mother when requested", () => {
expect(hiMom("Mother")).toBe("Hi, Mother!");
});
test("should say hi to mom in tamil when requested", () => {
expect(hiMom("", "ta")).toContain("வணக்கம் அம்மா");
});
test("should say hi to mom in german when requested", () => {
expect(hiMom("", "de")).toContain("Hallo");
});
test("should say hi to mom in danish when requested", () => {
expect(hiMom("", "da")).toContain("Hej");
});
test("should say hi to mom in russian when requested", () => {
expect(hiMom("", "ru")).toBe("Привет, мама!");
});
test("should say hi to mom in persian when requested", () => {
expect(hiMom("", "fa")).toContain("مامان");
});
test("should say hi to Mother in french when requested", () => {
expect(hiMom("Mother", "fr")).toContain("Mother");
});
test("should say hi to Mother in arabic when requested", () => {
expect(hiMom("", "ar-IQ")).toContain("يمه");
});
test("should say hi to Mother in darija (Moroccan Arabic) when requested", () => {
expect(hiMom("", "ar-MA")).toContain("ماما");
});
test("nl-Be should not say the same as nl-NL when requested", () => {
expect(hiMom("", "nl-BE")).not.toBe(hiMom("", "nl-NL"));
});
test("should say hi to Mother in assamese when requested", () => {
expect(hiMom("", "as")).toContain("অ' মা");
});
test("should say hi to mom in pirate speak when requested", () => {
expect(hiMom("", "en-PT")).toContain("Ahoy,");
});
test("should say hi to Mother in azerbaijani when requested", () => {
expect(hiMom("", "az")).toBe("Salam, ana!");
});
test("should say hi to Mother in Swedish and not Bork Bork!", () => {
expect(hiMom("", "se")).toBe("Hej, mamma!");
});
test("should say hi to Mother in Norwegian Bokmål when requested", () => {
expect(hiMom("", "no-NB")).toBe("Hei, mamma!");
});
test("should say hi to Mother in Norwegian Nynorsk when requested", () => {
expect(hiMom("", "no-NN")).toBe("Hei, mamma!");
});
test("should say hi to Mother in Croatian when requested", () => {
expect(hiMom("", "hr")).toBe("Bok, mama!");
});
test("should say hi to Mother in Filipino when requested", () => {
expect(hiMom("", "tl")).toBe("Kamusta po, nanay!");
});
test("should say hi to Mother in Crimean when requested", () => {
expect(hiMom("", "qt")).toBe("Selâm, anam!");
});
test("should say hi to Mother in Marathi when requested", () => {
expect(hiMom("", "mar")).toBe("नमस्कार, आई!");
});
test("should say hi to mom in Bengali when requested", () => {
expect(hiMom("", "bn")).toBe("নমস্কার, মা!");
});
test("should throw error when requested", () => {
expect(() => hiMom("", "")).toThrowError(/language/i);
});