Skip to content

Commit bd9d48e

Browse files
committed
tests: added unit test
1 parent 2290e4b commit bd9d48e

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

test/index.spec.ts

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,49 @@
1-
import { myPackage } from '../src';
1+
import { Script, translate } from '../src';
22

3-
describe('index', () => {
4-
describe('myPackage', () => {
5-
it('should return a string containing the message', () => {
6-
const message = 'Hello';
3+
describe('baybayin', () => {
4+
describe('translate', () => {
5+
it('should return a string containing the baybayin text', () => {
6+
const text = 'a';
77

8-
const result = myPackage(message);
8+
const result = translate(text);
99

10-
expect(result).toMatch(message);
10+
expect(result).toMatch('\u1700');
11+
});
12+
});
13+
});
14+
15+
describe('hanunoo', () => {
16+
describe('translate', () => {
17+
it('should return a string containing the hanunoo text', () => {
18+
const text = 'a';
19+
20+
const result = translate(text, Script.HANUNOO);
21+
22+
expect(result).toMatch('\u1720');
23+
});
24+
});
25+
});
26+
27+
describe('buhid', () => {
28+
describe('translate', () => {
29+
it('should return a string containing the buhid text', () => {
30+
const text = 'nga';
31+
32+
const result = translate(text, Script.BUHID);
33+
34+
expect(result).toMatch('\u1745');
35+
});
36+
});
37+
});
38+
39+
describe('tagbanwa', () => {
40+
describe('translate', () => {
41+
it('should return a string containing the tagbanwa text', () => {
42+
const text = 'nga';
43+
44+
const result = translate(text, Script.TAGBANWA);
45+
46+
expect(result).toMatch('\u1765');
1147
});
1248
});
1349
});

0 commit comments

Comments
 (0)