<commit_before>import path from 'path';
import temp from 'temp';
import fs from 'fs-extra';

import {cloneRepository} from '../helpers';

import WorkdirCache from '../../lib/models/workdir-cache';

describe('WorkdirCache', function() {
  let cache;

  beforeEach(function() {
    cache = new WorkdirCache(5);
  });

  it('finds a workdir that is the given path', async function() {
    const sameDir = await cloneRepository('three-files');
    const workDir = await cache.find(sameDir);
    assert.equal(sameDir, workDir);
  });
<commit_msg>Cover the default parameter in WorkdirCache's constructor<commit_after>import path from 'path';
import temp from 'temp';
import fs from 'fs-extra';

import {cloneRepository} from '../helpers';

import WorkdirCache from '../../lib/models/workdir-cache';

describe('WorkdirCache', function() {
  let cache;

  beforeEach(function() {
    cache = new WorkdirCache(5);
  });

  it('defaults to 1000 entries', function() {
    assert.strictEqual((new WorkdirCache()).maxSize, 1000);
  });

  it('finds a workdir that is the given path', async function() {
    const sameDir = await cloneRepository('three-files');
    const workDir = await cache.find(sameDir);
    assert.equal(sameDir, workDir);
  });

{'fraction_non_alphanumeric': 0.14447134786117838, 'fraction_numerical': 0.008071025020177562, 'mean_word_length': 4.299145299145299, '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': '502833', 'n_tokens_mistral': 377, 'n_tokens_neox': 363, 'n_words': 110}