<commit_before>'use strict';

// execute with `mocha test.js`

(function() {

  let expect = require(`chai`).expect,
      Listifier = require(`../lib/listify`),
      newlistifier = new Listifier();

// for functional tests
let getText = function() {

  let Corpora = require(`common-corpus`),
      corpora = new Corpora(),
      source = corpora.texts,
      chars = 50000,
      textObj = source[2], // eh.....
      blob = textObj.text();

  return {
    text: blob,
    source: textObj.name
  };

};

  describe(`listifier`, function() {

    describe(`API`, function() {
      it(`should return a new instance with new`, function() {
        expect(newlistifier).to.be.a(`object`);
        expect(newlistifier).to.be.an.instanceof(Listifier);
      });

      it(`should return a new instance even without new`, function() {
        var listifier = Listifier();
        expect(listifier).to.be.a(`object`);
        expect(listifier).to.be.an.instanceof(Listifier);
      });


      it(`should expose a getList method`, function() {
        expect(newlistifier.getList).to.be.a(`function`);
      });
    });

    describe(`functional tests`, function() {
      let list = newlistifier.getList({text: getText()});
      it('should return an object', function() {
        let list = newlistifier.getList({text: getText()});
        expect(list).to.be.an('object');
      });
      it('object should have a list array', function() {
        let list = newlistifier.getList({text: getText()});
        expect(list.list).to.be.an('array');
        expect(list.list).to.have.length.above(0);
        expect(list.list[0]).to.be.a(`string`);
      });
      it('object should have metadata', function() {
        let list = newlistifier.getList({text: getText()});
        expect(list.metadata).to.be.an('object');
      });
    });

  });

}());<commit_msg>minor test cleanup<commit_after>'use strict';

// execute with `mocha test.js`

(function() {

  let expect = require(`chai`).expect,
      Listifier = require(`../lib/listify`),
      newlistifier = new Listifier();

// for functional tests
  let getText = function() {

    let Corpora = require(`common-corpus`),
        corpora = new Corpora(),
        source = corpora.texts,
        textObj = source[2], // eh.....
        blob = textObj.text();

    return {
      text: blob,
      source: textObj.name
    };

  };

  describe(`listifier`, function() {

    describe(`API`, function() {
      it(`should return a new instance with new`, function() {
        expect(newlistifier).to.be.a(`object`);
        expect(newlistifier).to.be.an.instanceof(Listifier);
      });

      it(`should return a new instance even without new`, function() {
        var listifier = Listifier();
        expect(listifier).to.be.a(`object`);
        expect(listifier).to.be.an.instanceof(Listifier);
      });


      it(`should expose a getList method`, function() {
        expect(newlistifier.getList).to.be.a(`function`);
      });
    });

    describe(`functional tests`, function() {
      let list = newlistifier.getList({text: getText()});
      it(`should return an object`, function() {
        expect(list).to.be.an(`object`);
      });
      it(`object should have a list array`, function() {
        expect(list.list).to.be.an(`array`);
        expect(list.list).to.have.length.above(0);
        expect(list.list[0]).to.be.a(`string`);
      });
      it(`object should have metadata`, function() {
        expect(list.metadata).to.be.an(`object`);
      });
    });

  });

}());
{'fraction_non_alphanumeric': 0.17504234895539245, 'fraction_numerical': 0.003105590062111801, 'mean_word_length': 2.6079429735234214, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '772700', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1073, 'n_words': 222}