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