Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@bochilteam/scraper/lib/esm/texts/test.js
1126 views
1
import { expect } from 'chai';
2
import { latinToAksara, aksaraToLatin, bucin, bucinjson, dare, darejson, truth, truthjson, textpro, textproList } from './index.js';
3
describe('Texts', () => {
4
describe('Aksara Jawa', () => {
5
it('Latin to Aksara', done => {
6
try {
7
const res = latinToAksara('hallo rek');
8
expect(res).equal('ꦲꦭ꧀ꦭꦺꦴ​ꦫꦺꦏ꧀');
9
return done();
10
}
11
catch (e) {
12
return done(e);
13
}
14
});
15
it('Aksara to Latin', done => {
16
try {
17
const res = aksaraToLatin('ꦲꦭ꧀ꦭꦺꦴ​ꦫꦺꦏ꧀', { HVokal: false });
18
expect(res).equal('hal​lo rek​');
19
return done();
20
}
21
catch (e) {
22
return done(e);
23
}
24
});
25
});
26
describe('Bucin', () => {
27
it('Bucin', done => {
28
bucin().then(res => {
29
expect(res).to.be.a('string');
30
return done();
31
}).catch(done);
32
});
33
it('Bucin JSON', done => {
34
const res = bucinjson;
35
expect(res).to.be.an('array');
36
expect(res).to.have.lengthOf.at.least(365);
37
return done();
38
});
39
});
40
describe('Dare', () => {
41
it('Dare', done => {
42
dare().then(res => {
43
expect(res).to.be.a('string');
44
return done();
45
}).catch(done);
46
});
47
it('Dare JSON', done => {
48
const res = darejson;
49
expect(res).to.be.an('array');
50
expect(res).to.have.lengthOf.at.least(63);
51
return done();
52
});
53
});
54
describe('Truth', () => {
55
it('Truth', done => {
56
truth().then(res => {
57
expect(res).to.be.a('string');
58
return done();
59
}).catch(done);
60
});
61
it('Truth JSON', done => {
62
const res = truthjson;
63
expect(res).to.be.an('array');
64
expect(res).to.have.lengthOf.at.least(61);
65
return done();
66
});
67
});
68
describe('TextPro', () => {
69
it('TextPro', done => {
70
textpro('neon', ['Hallo']).then(res => {
71
expect(res).to.be.a('string');
72
return done();
73
}).catch(done);
74
});
75
it('TextPro List', done => {
76
Promise.resolve(textproList).then(res => {
77
expect(res).to.be.an('array');
78
expect(res).to.have.lengthOf.at.least(1);
79
return done();
80
}).catch(done);
81
});
82
});
83
});
84
//# sourceMappingURL=test.js.map
85