Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@bochilteam/scraper/lib/cjs/others/test.js
1126 views
1
"use strict";
2
Object.defineProperty(exports, "__esModule", { value: true });
3
const chai_1 = require("chai");
4
const index_js_1 = require("./index.js");
5
describe('Others', () => {
6
// TODO
7
describe('Minecraft', () => {
8
// it('Minecraft java', done => {
9
// statusJava('moelsmp2.mcalias.com', 25566).then(res => {
10
// expect(res).to.be.an('object')
11
// expect(res.ip).to.be.a('string')
12
// expect(res.port).to.be.a('number')
13
// expect(res.description).to.be.a('string')
14
// expect(res.descriptionText).to.be.a('string')
15
// expect(res.players).to.be.an('object')
16
// expect(res.players.max).to.be.a('number')
17
// expect(res.players.online).to.be.a('number')
18
// expect(res.players.sample).to.be.an('array')
19
// expect(res.version).to.be.an('object')
20
// expect(res.version.name).to.be.a('string')
21
// expect(res.version.protocol).to.be.a('number')
22
// expect(res.favicon).to.be.a('string')
23
// return done()
24
// }).catch(done)
25
// })
26
});
27
it('Wikipedia', (done) => {
28
(0, index_js_1.wikipedia)('Minecraft', 'en').then(res => {
29
(0, chai_1.expect)(res).to.be.an('object');
30
(0, chai_1.expect)(res.title).to.be.a('string');
31
(0, chai_1.expect)(res.img).to.be.a('string');
32
(0, chai_1.expect)(res.articles).to.be.a('string');
33
return done();
34
}).catch(done);
35
});
36
describe('Jadwal TV', () => {
37
it('Jadwal TV', done => {
38
(0, index_js_1.jadwalTV)('RCTI').then(res => {
39
(0, chai_1.expect)(res).to.be.an('object');
40
(0, chai_1.expect)(res.channel).to.be.a('string');
41
(0, chai_1.expect)(res.result).to.be.an('array');
42
(0, chai_1.expect)(res.result).to.have.lengthOf.at.least(1);
43
return done();
44
}).catch(done);
45
});
46
it('Jadwal TV NOW', done => {
47
(0, index_js_1.jadwalTVNow)().then(res => {
48
(0, chai_1.expect)(res).to.be.an('object');
49
Object.keys(res).forEach(key => {
50
(0, chai_1.expect)(key).to.be.a('string');
51
(0, chai_1.expect)(res[key]).to.be.an('array');
52
(0, chai_1.expect)(res[key]).to.have.lengthOf.at.least(2);
53
});
54
return done();
55
}).catch(done);
56
});
57
});
58
describe('Mediafire', () => {
59
it('Mediafire Download', done => {
60
(0, index_js_1.mediafiredl)('https://www.mediafire.com/file/gpeiucmm1xo6ln0/hello_world.mp4/file').then(res => {
61
(0, chai_1.expect)(res).to.be.an('object');
62
(0, chai_1.expect)(res.url).to.be.a('string');
63
(0, chai_1.expect)(res.url2).to.be.a('string');
64
(0, chai_1.expect)(res.filename).to.be.a('string');
65
(0, chai_1.expect)(res.filetype).to.be.a('string');
66
(0, chai_1.expect)(res.ext).to.be.a('string');
67
(0, chai_1.expect)(res.aploud).to.be.a('string');
68
(0, chai_1.expect)(res.filesizeH).to.be.a('string');
69
(0, chai_1.expect)(res.filesize).to.be.a('number');
70
return done();
71
}).catch(done);
72
});
73
});
74
describe('Gempa', () => {
75
it('Gempa', done => {
76
(0, index_js_1.gempa)().then(res => {
77
(0, chai_1.expect)(res).to.be.an('array');
78
res.forEach(({ date, locate, magnitude, depth, location, warning }) => {
79
(0, chai_1.expect)(date).to.be.a('string');
80
(0, chai_1.expect)(locate).to.be.a('string');
81
(0, chai_1.expect)(magnitude).to.be.a('string');
82
(0, chai_1.expect)(depth).to.be.a('string');
83
(0, chai_1.expect)(location).to.be.a('string');
84
(0, chai_1.expect)(warning).to.be.an('array');
85
warning.forEach(s => (0, chai_1.expect)(s).to.be.a('string'));
86
});
87
return done();
88
}).catch(done);
89
});
90
it('Gempa Now', done => {
91
(0, index_js_1.gempaNow)().then(res => {
92
(0, chai_1.expect)(res).to.be.an('array');
93
res.forEach(({ date, latitude, longitude, magnitude, depth, location }) => {
94
(0, chai_1.expect)(date).to.be.a('string');
95
(0, chai_1.expect)(latitude).to.be.a('string');
96
(0, chai_1.expect)(longitude).to.be.a('string');
97
(0, chai_1.expect)(magnitude).to.be.a('string');
98
(0, chai_1.expect)(depth).to.be.a('string');
99
(0, chai_1.expect)(location).to.be.a('string');
100
});
101
return done();
102
}).catch(done);
103
});
104
});
105
it('Tsunami', (done) => {
106
(0, index_js_1.tsunami)().then(res => {
107
(0, chai_1.expect)(res).to.be.an('array');
108
res.forEach(({ date, locate, magnitude, depth, location }) => {
109
(0, chai_1.expect)(date).to.be.a('string');
110
(0, chai_1.expect)(locate).to.be.a('string');
111
(0, chai_1.expect)(magnitude).to.be.a('string');
112
(0, chai_1.expect)(depth).to.be.a('string');
113
(0, chai_1.expect)(location).to.be.a('string');
114
});
115
return done();
116
}).catch(done);
117
});
118
describe('Lyrics', () => {
119
it('Lyrics', done => {
120
(0, index_js_1.lyrics)('rick astley never gonna give you up').then(res => {
121
(0, chai_1.expect)(res).to.be.an('object');
122
(0, chai_1.expect)(res.title).to.be.a('string');
123
(0, chai_1.expect)(res.author).to.be.a('string');
124
(0, chai_1.expect)(res.lyrics).to.be.a('string');
125
(0, chai_1.expect)(res.link).to.be.a('string');
126
return done();
127
}).catch(done);
128
});
129
// it('Lyrics V2', done => {
130
// lyricsv2('never gonna give you up').then(res => {
131
// expect(res.title).to.be.a('string')
132
// expect(res.author).to.be.a('string')
133
// expect(res.lyrics).to.be.a('string')
134
// expect(res.link).to.be.a('string')
135
// return done()
136
// }).catch(done)
137
// })
138
});
139
it('KBBI', done => {
140
(0, index_js_1.kbbi)('halo').then(res => {
141
(0, chai_1.expect)(res).to.be.an('array');
142
res.forEach(({ index, title, means }) => {
143
(0, chai_1.expect)(index).to.be.a('number');
144
(0, chai_1.expect)(title).to.be.a('string');
145
(0, chai_1.expect)(means).to.be.an('array');
146
means.forEach((mean) => (0, chai_1.expect)(mean).to.be.a('string'));
147
});
148
return done();
149
}).catch(done);
150
});
151
it('ID Free Fire', done => {
152
(0, index_js_1.nameFreeFire)('821587717').then(res => {
153
(0, chai_1.expect)(res).to.be.an('object');
154
(0, chai_1.expect)(res.username).to.be.a('string');
155
(0, chai_1.expect)(res.id).to.be.a('string');
156
return done();
157
}).catch(done);
158
});
159
describe('Bioskop', () => {
160
it('Bioskop now', done => {
161
(0, index_js_1.bioskopNow)().then(res => {
162
(0, chai_1.expect)(res).to.be.an('array');
163
(0, chai_1.expect)(res).to.have.lengthOf.at.least(1);
164
res.forEach(({ title, img, url, genre, duration, playingAt }) => {
165
(0, chai_1.expect)(title).to.be.a('string');
166
(0, chai_1.expect)(img).to.be.a('string');
167
(0, chai_1.expect)(url).to.be.a('string');
168
(0, chai_1.expect)(genre).to.be.a('string');
169
(0, chai_1.expect)(duration).to.be.a('string');
170
(0, chai_1.expect)(playingAt).to.be.a('string');
171
});
172
return done();
173
}).catch(done);
174
});
175
it('Bioskop', done => {
176
(0, index_js_1.bioskop)().then(res => {
177
(0, chai_1.expect)(res).to.be.an('array');
178
(0, chai_1.expect)(res).to.have.lengthOf.at.least(1);
179
res.forEach(({ title, img, url, genre, duration, release, director, cast }) => {
180
(0, chai_1.expect)(title).to.be.a('string');
181
(0, chai_1.expect)(img).to.be.a('string');
182
(0, chai_1.expect)(url).to.be.a('string');
183
(0, chai_1.expect)(genre).to.be.a('string');
184
(0, chai_1.expect)(duration).to.be.a('string');
185
(0, chai_1.expect)(release).to.be.a('string');
186
(0, chai_1.expect)(director).to.be.a('string');
187
(0, chai_1.expect)(cast).to.be.an('string');
188
});
189
return done();
190
}).catch(done);
191
});
192
});
193
});
194
//# sourceMappingURL=test.js.map
195