Path: blob/master/node_modules/@bochilteam/scraper/lib/cjs/news/test.js
1126 views
"use strict";1Object.defineProperty(exports, "__esModule", { value: true });2const chai_1 = require("chai");3const index_js_1 = require("./index.js");4describe('News', () => {5it('CNB indonesia', (done) => {6(0, index_js_1.cnbindonesia)().then(data => {7(0, chai_1.expect)(data).to.be.an('array');8(0, chai_1.expect)(data).to.have.length.at.least(1);9data.forEach(({ title, link, image, label, date }) => {10(0, chai_1.expect)(title).to.be.a('string');11(0, chai_1.expect)(link).to.be.a('string');12(0, chai_1.expect)(image).to.be.a('string');13(0, chai_1.expect)(label).to.be.a('string');14(0, chai_1.expect)(date).to.be.a('string');15});16return done();17}).catch(done);18});19it('antaranews', (done) => {20(0, index_js_1.antaranews)().then(data => {21(0, chai_1.expect)(data).to.be.an('array');22(0, chai_1.expect)(data).to.have.length.at.least(1);23data.forEach(({ title, link, image, label, date }) => {24(0, chai_1.expect)(title).to.be.a('string');25(0, chai_1.expect)(link).to.be.a('string');26(0, chai_1.expect)(image).to.be.a('string');27(0, chai_1.expect)(label).to.be.a('string');28(0, chai_1.expect)(date).to.be.a('string');29});30return done();31}).catch(done);32});33it('kompas', (done) => {34(0, index_js_1.kompas)().then(data => {35(0, chai_1.expect)(data).to.be.an('array');36data.forEach(({ title, link, image, label, date }) => {37(0, chai_1.expect)(title).to.be.a('string');38(0, chai_1.expect)(link).to.be.a('string');39(0, chai_1.expect)(image).to.be.a('string');40(0, chai_1.expect)(label).to.be.a('string');41(0, chai_1.expect)(date).to.be.a('string');42});43return done();44}).catch(done);45});46it('Suara.com', (done) => {47(0, index_js_1.suaracom)().then(data => {48(0, chai_1.expect)(data).to.be.an('array');49data.forEach(({ title, link, image, description, date }) => {50(0, chai_1.expect)(title).to.be.a('string');51(0, chai_1.expect)(link).to.be.a('string');52(0, chai_1.expect)(image).to.be.a('string');53(0, chai_1.expect)(description).to.be.a('string');54(0, chai_1.expect)(date).to.be.a('string');55});56return done();57}).catch(done);58});59it('Liputan6', (done) => {60(0, index_js_1.liputan6)().then(data => {61(0, chai_1.expect)(data).to.be.an('array');62data.forEach(({ title, link, image, description, label, date }) => {63(0, chai_1.expect)(title).to.be.a('string');64(0, chai_1.expect)(link).to.be.a('string');65(0, chai_1.expect)(image).to.be.a('string');66(0, chai_1.expect)(description).to.be.a('string');67(0, chai_1.expect)(label).to.be.a('string');68(0, chai_1.expect)(date).to.be.a('string');69});70return done();71}).catch(done);72});73it('Merdeka', (done) => {74(0, index_js_1.merdeka)().then(data => {75(0, chai_1.expect)(data).to.be.an('array');76data.forEach(({ title, link, image, label, date }) => {77(0, chai_1.expect)(title).to.be.a('string');78(0, chai_1.expect)(link).to.be.a('string');79(0, chai_1.expect)(image).to.be.a('string');80(0, chai_1.expect)(label).to.be.a('string');81(0, chai_1.expect)(date).to.be.a('string');82});83return done();84}).catch(done);85});86});87//# sourceMappingURL=test.js.map8889