<commit_before>import { expect } from 'chai';
import R from 'ramda';
import { createDummyAdapter, nonObjectValues } from 'stash-it-test-helpers';

import createItem from '../../../src/createItem';
import { createCache } from '../../../src/createCache';
import requiredMethods from '../../../src/requiredMethods';

describe('createCache', () => {
    const expectedMethodsWithHooksProperty = [
        'addExtra',
        'addHook',
        'addHooks',
        'buildKey',
        'getExtra',
        'getHooks',
        'getItem',
        'hasItem',
        'hooks',
        'removeItem',
        'setItem',
        'setExtra',
        'registerPlugins'
    ];

    let cache;
    let dummyAdapter;

    beforeEach(() => {
        dummyAdapter = createDummyAdapter(createItem);
        cache = createCache(dummyAdapter);
    });

    it('should create cache object', () => {
        expect(cache).to.be.ok;<commit_msg>Extract hooks property to separate variable<commit_after>import { expect } from 'chai';
import R from 'ramda';
import { createDummyAdapter, nonObjectValues } from 'stash-it-test-helpers';

import createItem from '../../../src/createItem';
import { createCache } from '../../../src/createCache';
import requiredMethods from '../../../src/requiredMethods';

describe('createCache', () => {
    const hooksProperty = 'hooks';
    const expectedMethodsWithHooksProperty = [
        'addExtra',
        'addHook',
        'addHooks',
        'buildKey',
        'getExtra',
        'getHooks',
        'getItem',
        'hasItem',
        'removeItem',
        'setItem',
        'setExtra',
        'registerPlugins',
        hooksProperty
    ];

    let cache;
    let dummyAdapter;

    beforeEach(() => {
        dummyAdapter = createDummyAdapter(createItem);
        cache = createCache(dummyAdapter);
    });

    it('should create cache object', () => {
        expect(cache).to.be.ok;
{'fraction_non_alphanumeric': 0.15416885159937074, 'fraction_numerical': 0.0, 'mean_word_length': 2.431654676258993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5505423', 'n_tokens_mistral': 538, 'n_tokens_neox': 544, 'n_words': 117}