<commit_before>import path from 'path';
import fs from 'fs';
import rimraf from 'rimraf';

import Chapter from '../../lib/crawlers/dmzj/chapter';

describe('Dmzj', () => {
  describe('Chapter#download', function () {
    const TEST_DIR = 'manga/篮球飞人/全彩版十日谈';
    beforeEach((done) => {
      rimraf(TEST_DIR, () => {
        done();
      });
    });

    this.timeout(120 * 1e3);

    it('download the manga chapter', async function () {
      const chapter = new Chapter('https://manhua.dmzj.com/lanqiufeiren/43293.shtml');
      await chapter.download(path.join(TEST_DIR, '{autoIndex}{suffix}'));
      // check the first image
      fs.existsSync(path.join(TEST_DIR, '01.jpg')).should.be.true();
      // check the last image
      fs.existsSync(path.join(TEST_DIR, '31.jpg')).should.be.true();
      // should not contain file that not belongs to this chapter
      fs.existsSync(path.join(TEST_DIR, '32.jpg')).should.be.false();
    });
  });
});<commit_msg>Wording.<commit_after>import path from 'path';
import fs from 'fs';
import rimraf from 'rimraf';

import Chapter from '../../lib/crawlers/dmzj/chapter';

describe('Dmzj', () => {
  describe('Chapter#download', function () {
    const TEST_DIR = 'manga/篮球飞人/全彩版十日谈';
    beforeEach((done) => {
      rimraf(TEST_DIR, () => {
        done();
      });
    });

    this.timeout(120 * 1e3);

    it('should download the manga chapter', async function () {
      const chapter = new Chapter('https://manhua.dmzj.com/lanqiufeiren/43293.shtml');
      await chapter.download(path.join(TEST_DIR, '{autoIndex}{suffix}'));
      // check the first image
      fs.existsSync(path.join(TEST_DIR, '01.jpg')).should.be.true();
      // check the last image
      fs.existsSync(path.join(TEST_DIR, '31.jpg')).should.be.true();
      // should not contain file that not belongs to this chapter
      fs.existsSync(path.join(TEST_DIR, '32.jpg')).should.be.false();
    });
  });
});
{'fraction_non_alphanumeric': 0.17875647668393782, 'fraction_numerical': 0.016580310880829015, 'mean_word_length': 3.152688172043011, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1328855', 'n_tokens_mistral': 681, 'n_tokens_neox': 660, 'n_words': 129}