<commit_before>var plexify = require('../');
var assert = require('assert');

describe('plexify', function() {
  it('should work', function() {
    assert(plexify);
  });
});<commit_msg>add tests.<commit_after>var plexify = require('../');
var assert = require('assert');

describe('plexify', function() {
  it('renames video files correctly', function(done) {
    const fileName = './The.Staying.Alive.S05E02.720p.HDTV.x264-KILLERS[rartv].avi';
    const destRoot = '/Volumes/TV_Shows';
    plexify(fileName, destRoot, (err, res) => {
      assert.ifError(err);
      assert.equal(res, '/Volumes/TV_Shows/The Staying Alive/Season 5/The Staying Alive - s05e02.avi');
      done();
    });
  });
  it('ignores files without season/episode information ', function(done) {
    const fileName = './The.Staying.Alive.S05.720p.HDTV.x264-KILLERS[rartv].avi';
    const destRoot = '/Volumes/TV_Shows';
    plexify(fileName, destRoot, (err) => {
      assert.ok(err);
      assert.ok(err.message.match(/cannot parse filename/));
      done();
    });
  });
});
{'fraction_non_alphanumeric': 0.18648905803996194, 'fraction_numerical': 0.021883920076117985, 'mean_word_length': 3.6964285714285716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1831144', 'n_tokens_mistral': 382, 'n_tokens_neox': 360, 'n_words': 66}