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