<commit_before>var config = require('../../src/config');
var expect = require('chai').expect;
var getTransformers = require('../../src/get-transformers');

var before = global.before;
var describe = global.describe;
var it = global.it;

var foo = require('../transformers/foo');
var fooVersion = require('../transformers/foo/package').version;
var bar = require('../transformers/bar');
var barVersion = require('../transformers/bar/package').version;

describe('getTransformers(filePath, config)', function () {
  before(function () {
    config.set({
      pipe: [
        {
          name: './test/transformers/foo',
          only: '**/*.es6'
        },
        {
          name: './test/transformers/foo',
          only: ['only.a'],
          ext: '.c',
          options: {foo: 'bar'}
        },
        {
          name: './test/transformers/foo',
          only: '**/*.a',
          ext: '.b'
        },
        {
          name: './test/transformers/foo',
          only: '**/*.c',
          options: {buz: 'baz'}
        },
        {
          name: './test/transformers/bar',
          only: '**/*.c',
          except: 'except.*',
          options: {foo: 'bar'}
        }
      ]
    });
  });

  it('works with no transformers', function () {
    expect(getTransformers('file.png')).to.deep.equal([]);
  });

  it('works with one transformer', function () {
    expect(getTransformers('file.es6')).to.deep.equal([{
      name: './test/transformers/foo',
      only: '**/*.es6',
      options: {},
      fn: foo,
      version: fooVersion
    }]);
  });

  it('works with chained transformers', function () {
    expect(getTransformers('file.a')).to.deep.equal([{
      name: './test/transformers/foo',
      only: '**/*.a',
      ext: '.b',
      options: {},
      fn: foo,
      version: fooVersion
    }]);
  });

  it('respects `only` arrays', function () {
    expect(getTransformers('file.a')).to.deep.equal([{
      name: './test/transformers/foo',
      only: ['only.a'],
      ext: '.c',
      options: {},
      fn: foo,
      version: fooVersion
    }, {
      name: './test/transformers/foo',
      only: '**/*.c',
      options: {buz: 'baz'},
      fn: foo,
      version: fooVersion
    }, {
      name: './test/transformers/bar',
      only: '**/*.c',
      except: 'except.*',
      options: {foo: 'bar'},
      fn: bar,
      version: barVersion
    }]);
  });

  it('respects `except` arrays', function () {
    expect(getTransformers('except.a')).to.deep.equal([{
      name: './test/transformers/foo',
      options: {},
      fn: foo,
      version: fooVersion
    }, {
      name: './test/transformers/foo',
      options: {buz: 'baz'},
      fn: foo,
      version: fooVersion
    }]);
  });
});<commit_msg>Fix tests<commit_after>var config = require('../../src/config');
var expect = require('chai').expect;
var getTransformers = require('../../src/get-transformers');

var before = global.before;
var describe = global.describe;
var it = global.it;

var foo = require('../transformers/foo');
var fooVersion = require('../transformers/foo/package').version;
var bar = require('../transformers/bar');
var barVersion = require('../transformers/bar/package').version;

describe('getTransformers(filePath, config)', function () {
  before(function () {
    config.set({
      pipe: [
        {
          name: './test/transformers/foo',
          only: '**/*.es6'
        },
        {
          name: './test/transformers/foo',
          only: ['only.a'],
          ext: '.c',
          options: {foo: 'bar'}
        },
        {
          name: './test/transformers/foo',
          only: '**/*.a',
          except: ['except.a'],
          ext: '.b'
        },
        {
          name: './test/transformers/foo',
          only: '**/*.c',
          options: {buz: 'baz'}
        },
        {
          name: './test/transformers/bar',
          only: '**/*.c',
          except: 'except.*',
          options: {foo: 'bar'}
        }
      ]
    });
  });

  it('works with no transformers', function () {
    expect(getTransformers('file.png')).to.deep.equal([]);
  });

  it('works with one transformer', function () {
    expect(getTransformers('file.es6')).to.deep.equal([{
      name: './test/transformers/foo',
      only: '**/*.es6',
      options: {},
      fn: foo,
      version: fooVersion
    }]);
  });

  it('works with chained transformers', function () {
    expect(getTransformers('file.a')).to.deep.equal([{
      name: './test/transformers/foo',
      only: '**/*.a',
      except: ['except.a'],
      ext: '.b',
      options: {},
      fn: foo,
      version: fooVersion
    }]);
  });

  it('respects `only` arrays', function () {
    expect(getTransformers('only.a')).to.deep.equal([{
      name: './test/transformers/foo',
      only: ['only.a'],
      ext: '.c',
      options: {foo: 'bar'},
      fn: foo,
      version: fooVersion
    }, {
      name: './test/transformers/foo',
      only: '**/*.c',
      options: {buz: 'baz'},
      fn: foo,
      version: fooVersion
    }, {
      name: './test/transformers/bar',
      only: '**/*.c',
      except: 'except.*',
      options: {foo: 'bar'},
      fn: bar,
      version: barVersion
    }]);
  });

  it('respects `except` arrays', function () {
    expect(getTransformers('except.a')).to.deep.equal([]);
  });
});
{'fraction_non_alphanumeric': 0.20881801125703564, 'fraction_numerical': 0.001125703564727955, 'mean_word_length': 2.010163749294184, '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': '7561876', 'n_tokens_mistral': 1704, 'n_tokens_neox': 1692, 'n_words': 331}