<commit_before>var logs = require('../');
var test = require('tape');
var isFunction = require('lodash.isfunction');
var isReadable = require('isstream').isReadable;
var isPlainObject = require('is-plain-object');
var keys = Object.keys || require('object-keys');
var isString = require('is-string');

test('exports a function', function(t) {
  t.plan(1);
  t.ok(isFunction(logs));
});

test('returns a readable stream', function(t) {
  t.plan(1);
  t.ok(isReadable(logs({channel: 'Destinygg', date: '2015-10-21'})));
});

test('emits objects', function(t) {
  logs({channel: 'Destinygg', date: '2015-10-21'})
    .on('error', function(error) {
      t.error(error);
    })
    .on('data', function(data) {
      t.ok(isPlainObject(data));
      t.ok(keys(data).length, 3);
      t.ok(isString(data.timestamp));
      t.ok(isString(data.user));
      t.ok(isString(data.message));
    })
    .on('end', function() {
      t.end();
    });
});

test('works with lowercase channel', function(t) {
  logs({channel: 'destinygg', date: '2015-10-21'})
    .on('error', function(error) {
      t.error(error);
    })
    .on('data', function(data) {
      t.ok(isPlainObject(data));
      t.ok(keys(data).length, 3);
      t.ok(isString(data.timestamp));
      t.ok(isString(data.user));
      t.ok(isString(data.message));
    })
    .on('end', function() {
      t.end();
    });
});

test('specific user', function(t) {
  logs({channel: 'destinygg', date: '2015-10-21', user: 'sztanpet'})
    .on('error', function(error) {
      t.error(error);
    })
    .on('data', function(data) {
      t.ok(isPlainObject(data));
      t.ok(keys(data).length, 3);
      t.ok(isString(data.timestamp));
      t.ok(isString(data.user));
      t.ok(isString(data.message));
    })
    .on('end', function() {
      t.end();
    });
});
<commit_msg>test: reduce number of assertions<commit_after>var logs = require('../');
var test = require('tape');
var isFunction = require('lodash.isfunction');
var isReadable = require('isstream').isReadable;
var isPlainObject = require('is-plain-object');
var keys = Object.keys || require('object-keys');
var isString = require('is-string');

test('exports a function', function(t) {
  t.plan(1);
  t.ok(isFunction(logs));
});

test('returns a readable stream', function(t) {
  t.plan(1);
  t.ok(isReadable(logs({channel: 'Destinygg', date: '2015-10-21'})));
});

test('emits objects', function(t) {
  logs({channel: 'Destinygg', date: '2015-10-21'})
    .on('error', function(error) {
      t.error(error);
    })
    .on('data', function(data) {
      t.ok(isPlainObject(data)
        && keys(data).length === 3
        && isString(data.timestamp)
        && isString(data.user)
        && isString(data.message));
    })
    .on('end', function() {
      t.end();
    });
});

test('works with lowercase channel', function(t) {
  logs({channel: 'destinygg', date: '2015-10-21'})
    .on('error', function(error) {
      t.error(error);
    })
    .on('data', function(data) {
      t.ok(isPlainObject(data)
        && keys(data).length === 3
        && isString(data.timestamp)
        && isString(data.user)
        && isString(data.message));
    })
    .on('end', function() {
      t.end();
    });
});

test('specific user', function(t) {
  logs({channel: 'destinygg', date: '2015-10-21', user: 'sztanpet'})
    .on('error', function(error) {
      t.error(error);
    })
    .on('data', function(data) {
      t.ok(isPlainObject(data)
        && keys(data).length === 3
        && isString(data.timestamp)
        && isString(data.user)
        && isString(data.message));
    })
    .on('end', function() {
      t.end();
    });
});

{'fraction_non_alphanumeric': 0.21637107776261938, 'fraction_numerical': 0.020190995907230558, 'mean_word_length': 3.184931506849315, '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': '2522529', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1296, 'n_words': 214}