Path: blob/master/node_modules/@bochilteam/scraper/lib/esm/texts/test.js
1126 views
import { expect } from 'chai';1import { latinToAksara, aksaraToLatin, bucin, bucinjson, dare, darejson, truth, truthjson, textpro, textproList } from './index.js';2describe('Texts', () => {3describe('Aksara Jawa', () => {4it('Latin to Aksara', done => {5try {6const res = latinToAksara('hallo rek');7expect(res).equal('ꦲꦭ꧀ꦭꦺꦴꦫꦺꦏ꧀');8return done();9}10catch (e) {11return done(e);12}13});14it('Aksara to Latin', done => {15try {16const res = aksaraToLatin('ꦲꦭ꧀ꦭꦺꦴꦫꦺꦏ꧀', { HVokal: false });17expect(res).equal('hallo rek');18return done();19}20catch (e) {21return done(e);22}23});24});25describe('Bucin', () => {26it('Bucin', done => {27bucin().then(res => {28expect(res).to.be.a('string');29return done();30}).catch(done);31});32it('Bucin JSON', done => {33const res = bucinjson;34expect(res).to.be.an('array');35expect(res).to.have.lengthOf.at.least(365);36return done();37});38});39describe('Dare', () => {40it('Dare', done => {41dare().then(res => {42expect(res).to.be.a('string');43return done();44}).catch(done);45});46it('Dare JSON', done => {47const res = darejson;48expect(res).to.be.an('array');49expect(res).to.have.lengthOf.at.least(63);50return done();51});52});53describe('Truth', () => {54it('Truth', done => {55truth().then(res => {56expect(res).to.be.a('string');57return done();58}).catch(done);59});60it('Truth JSON', done => {61const res = truthjson;62expect(res).to.be.an('array');63expect(res).to.have.lengthOf.at.least(61);64return done();65});66});67describe('TextPro', () => {68it('TextPro', done => {69textpro('neon', ['Hallo']).then(res => {70expect(res).to.be.a('string');71return done();72}).catch(done);73});74it('TextPro List', done => {75Promise.resolve(textproList).then(res => {76expect(res).to.be.an('array');77expect(res).to.have.lengthOf.at.least(1);78return done();79}).catch(done);80});81});82});83//# sourceMappingURL=test.js.map8485