<commit_before>const test = require('ava')
const {
  isFile,
  isNotFile,
  isDirectory,
  isNotDirectory,
  subdirectories
} = require('../../src/utils/filesystem-utils')
const { contains } = require('ramda')

test('isFile', t => {
  t.true(isFile(__filename))
  t.false(isFile(__dirname))
})

test('isNotFile', t => {
  t.false(isNotFile(__filename))
  t.true(isNotFile(__dirname))
})

test('isDirectory', t => {
  t.true(isDirectory(__dirname))
  t.false(isDirectory(__filename))
})

test('isNotDirectory', t => {
  t.false(isNotDirectory(__dirname))
  t.true(isNotDirectory(__filename))
})

test('subdirectories', t => {
  const dirs = subdirectories(`${__dirname}/..`)
  t.is(7, dirs.length)
  t.true(contains(`${__dirname}/../utils`, dirs))
})

test('relative subdirectories', t => {
  const dirs = subdirectories(`${__dirname}/..`, true)
  t.is(7, dirs.length)
  t.true(contains(`utils`, dirs))
})

test('filtered subdirectories', t => {
  const dirs = subdirectories(`${__dirname}/..`, true, 'ut*')
  t.is(1, dirs.length)
  t.true(contains(`utils`, dirs))
})<commit_msg>Seriously fixes the tests (#153)<commit_after>const test = require('ava')
const {
  isFile,
  isNotFile,
  isDirectory,
  isNotDirectory,
  subdirectories
} = require('../../src/utils/filesystem-utils')
const { contains } = require('ramda')

test('isFile', t => {
  t.true(isFile(__filename))
  t.false(isFile(__dirname))
})

test('isNotFile', t => {
  t.false(isNotFile(__filename))
  t.true(isNotFile(__dirname))
})

test('isDirectory', t => {
  t.true(isDirectory(__dirname))
  t.false(isDirectory(__filename))
})

test('isNotDirectory', t => {
  t.false(isNotDirectory(__dirname))
  t.true(isNotDirectory(__filename))
})

test('subdirectories', t => {
  const dirs = subdirectories(`${__dirname}/..`)
  t.is(6, dirs.length)
  t.true(contains(`${__dirname}/../utils`, dirs))
})

test('relative subdirectories', t => {
  const dirs = subdirectories(`${__dirname}/..`, true)
  t.is(6, dirs.length)
  t.true(contains(`utils`, dirs))
})

test('filtered subdirectories', t => {
  const dirs = subdirectories(`${__dirname}/..`, true, 'ut*')
  t.is(1, dirs.length)
  t.true(contains(`utils`, dirs))
})
{'fraction_non_alphanumeric': 0.2064367816091954, 'fraction_numerical': 0.004137931034482759, 'mean_word_length': 4.929155313351498, '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': '2554752', 'n_tokens_mistral': 800, 'n_tokens_neox': 792, 'n_words': 126}