<commit_before>import path from 'path';
import { expect } from 'chai';
import getFiles from '../src/getFiles';

const assetsPath = path.resolve(__dirname, 'assets');

const njoin = (x, y) => path.normalize(path.join(x, y))

describe('getFiles', () => {
  it('get recursively the files in the output path', () => {
    const files = getFiles(assetsPath);
    expect(files).to.have.length(7);
    expect(files).to.include(njoin(assetsPath, 'folder/p.txt'));
    expect(files).to.include(njoin(assetsPath, 'folder/q.txt'));
    expect(files).to.include(njoin(assetsPath, 'a.txt'));
    expect(files).to.include(njoin(assetsPath, 'b.txt'));
    expect(files).to.include(njoin(assetsPath, 'bundle.js'));
    expect(files).to.include(njoin(assetsPath, 'foo.json'));
    expect(files).to.include(njoin(assetsPath, 'z.txt'));
  });
  it('handles trailing slash correctly', () => {
    const files = getFiles(assetsPath + '/');
    expect(files).to.include(njoin(assetsPath, 'folder/p.txt'));
  });
  it('handles relative paths', () => {
    const files = getFiles('./test/assets');
    expect(files).to.include('test/assets/folder/p.txt');
  });
  it('get recursively the files in the relative path using POSIX separator', () => {
    const files = getFiles('./test/assets');
    expect(files).to.have.length(7);
    expect(files).to.include(njoin('./test/assets', 'folder/p.txt'));
    expect(files).to.include(njoin('./test/assets', 'folder/q.txt'));
    expect(files).to.include(njoin('./test/assets', 'a.txt'));
    expect(files).to.include(njoin('./test/assets', 'b.txt'));
    expect(files).to.include(njoin('./test/assets', 'bundle.js'));
    expect(files).to.include(njoin('./test/assets', 'foo.json'));
    expect(files).to.include(njoin('./test/assets', 'z.txt'));
  });
  it('exclude files from array', () => {
    const files = getFiles(assetsPath, ['a.txt', 'b.txt']);<commit_msg>Lint file<commit_after>import path from 'path';
import { expect } from 'chai';
import getFiles from '../src/getFiles';

const assetsPath = path.resolve(__dirname, 'assets');

const njoin = (x, y) => path.normalize(path.join(x, y));

describe('getFiles', () => {
  it('get recursively the files in the output path', () => {
    const files = getFiles(assetsPath);
    expect(files).to.have.length(7);
    expect(files).to.include(njoin(assetsPath, 'folder/p.txt'));
    expect(files).to.include(njoin(assetsPath, 'folder/q.txt'));
    expect(files).to.include(njoin(assetsPath, 'a.txt'));
    expect(files).to.include(njoin(assetsPath, 'b.txt'));
    expect(files).to.include(njoin(assetsPath, 'bundle.js'));
    expect(files).to.include(njoin(assetsPath, 'foo.json'));
    expect(files).to.include(njoin(assetsPath, 'z.txt'));
  });
  it('handles trailing slash correctly', () => {
    const files = getFiles(`${assetsPath}/`);
    expect(files).to.include(njoin(assetsPath, 'folder/p.txt'));
  });
  it('handles relative paths', () => {
    const files = getFiles('./test/assets');
    expect(files).to.include('test/assets/folder/p.txt');
  });
  it('get recursively the files in the relative path using POSIX separator', () => {
    const files = getFiles('./test/assets');
    expect(files).to.have.length(7);
    expect(files).to.include(njoin('./test/assets', 'folder/p.txt'));
    expect(files).to.include(njoin('./test/assets', 'folder/q.txt'));
    expect(files).to.include(njoin('./test/assets', 'a.txt'));
    expect(files).to.include(njoin('./test/assets', 'b.txt'));
    expect(files).to.include(njoin('./test/assets', 'bundle.js'));
    expect(files).to.include(njoin('./test/assets', 'foo.json'));
    expect(files).to.include(njoin('./test/assets', 'z.txt'));
  });
  it('exclude files from array', () => {
    const files = getFiles(assetsPath, ['a.txt', 'b.txt']);
{'fraction_non_alphanumeric': 0.22006902044066898, 'fraction_numerical': 0.0010618529333687285, 'mean_word_length': 4.413793103448276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '1408226', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1245, 'n_words': 206}