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/news/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('News', () => {
6
it('CNB indonesia', (done) => {
7
(0, index_js_1.cnbindonesia)().then(data => {
8
(0, chai_1.expect)(data).to.be.an('array');
9
(0, chai_1.expect)(data).to.have.length.at.least(1);
10
data.forEach(({ title, link, image, label, date }) => {
11
(0, chai_1.expect)(title).to.be.a('string');
12
(0, chai_1.expect)(link).to.be.a('string');
13
(0, chai_1.expect)(image).to.be.a('string');
14
(0, chai_1.expect)(label).to.be.a('string');
15
(0, chai_1.expect)(date).to.be.a('string');
16
});
17
return done();
18
}).catch(done);
19
});
20
it('antaranews', (done) => {
21
(0, index_js_1.antaranews)().then(data => {
22
(0, chai_1.expect)(data).to.be.an('array');
23
(0, chai_1.expect)(data).to.have.length.at.least(1);
24
data.forEach(({ title, link, image, label, date }) => {
25
(0, chai_1.expect)(title).to.be.a('string');
26
(0, chai_1.expect)(link).to.be.a('string');
27
(0, chai_1.expect)(image).to.be.a('string');
28
(0, chai_1.expect)(label).to.be.a('string');
29
(0, chai_1.expect)(date).to.be.a('string');
30
});
31
return done();
32
}).catch(done);
33
});
34
it('kompas', (done) => {
35
(0, index_js_1.kompas)().then(data => {
36
(0, chai_1.expect)(data).to.be.an('array');
37
data.forEach(({ title, link, image, label, date }) => {
38
(0, chai_1.expect)(title).to.be.a('string');
39
(0, chai_1.expect)(link).to.be.a('string');
40
(0, chai_1.expect)(image).to.be.a('string');
41
(0, chai_1.expect)(label).to.be.a('string');
42
(0, chai_1.expect)(date).to.be.a('string');
43
});
44
return done();
45
}).catch(done);
46
});
47
it('Suara.com', (done) => {
48
(0, index_js_1.suaracom)().then(data => {
49
(0, chai_1.expect)(data).to.be.an('array');
50
data.forEach(({ title, link, image, description, date }) => {
51
(0, chai_1.expect)(title).to.be.a('string');
52
(0, chai_1.expect)(link).to.be.a('string');
53
(0, chai_1.expect)(image).to.be.a('string');
54
(0, chai_1.expect)(description).to.be.a('string');
55
(0, chai_1.expect)(date).to.be.a('string');
56
});
57
return done();
58
}).catch(done);
59
});
60
it('Liputan6', (done) => {
61
(0, index_js_1.liputan6)().then(data => {
62
(0, chai_1.expect)(data).to.be.an('array');
63
data.forEach(({ title, link, image, description, label, date }) => {
64
(0, chai_1.expect)(title).to.be.a('string');
65
(0, chai_1.expect)(link).to.be.a('string');
66
(0, chai_1.expect)(image).to.be.a('string');
67
(0, chai_1.expect)(description).to.be.a('string');
68
(0, chai_1.expect)(label).to.be.a('string');
69
(0, chai_1.expect)(date).to.be.a('string');
70
});
71
return done();
72
}).catch(done);
73
});
74
it('Merdeka', (done) => {
75
(0, index_js_1.merdeka)().then(data => {
76
(0, chai_1.expect)(data).to.be.an('array');
77
data.forEach(({ title, link, image, label, date }) => {
78
(0, chai_1.expect)(title).to.be.a('string');
79
(0, chai_1.expect)(link).to.be.a('string');
80
(0, chai_1.expect)(image).to.be.a('string');
81
(0, chai_1.expect)(label).to.be.a('string');
82
(0, chai_1.expect)(date).to.be.a('string');
83
});
84
return done();
85
}).catch(done);
86
});
87
});
88
//# sourceMappingURL=test.js.map
89