<commit_before>jest.unmock('../../lib/context-store/memory-context-store.js');

const MemoryContextStore = require('../../lib/context-store/memory-context-store.js');

describe('memory context store', () => {

  it('calls callback once constructed', () => {
    var callback = jest.fn()
    var contextStore = new MemoryContextStore(callback)
    expect(callback).toBeCalled()
  })

  it('stores context', () => {
    var contextStore = new MemoryContextStore(jest.fn())
    contextStore.set("key", {})
    expect(contextStore.memory["key"]).toBeTruthy()
  });

  it('retrieves context', () => {
    var contextStore = new MemoryContextStore(jest.fn())
    contextStore.memory = {"key": {}}
    contextStore.get("key", (context) => {
      expect(context).toBeTruthy()
    })
  });
});<commit_msg>Memory context store fully tested.<commit_after>jest.unmock('../../lib/context-store/memory-context-store.js');

const MemoryContextStore = require('../../lib/context-store/memory-context-store.js');

describe('memory context store', () => {

  it('calls callback once started', () => {
    var callback = jest.fn()

    var contextStore = new MemoryContextStore()
    contextStore.start(callback)

    expect(callback).toBeCalled()
  })

  it('stores context', () => {
    var contextStore = new MemoryContextStore()
    contextStore.set("key", {})
    expect(contextStore.memory["key"]).toBeTruthy()
  });

  it('retrieves context', () => {
    var contextStore = new MemoryContextStore()
    contextStore.memory = {"key": {}}
    contextStore.get("key", (context) => {
      expect(context).toBeTruthy()
    })
  });
});
{'fraction_non_alphanumeric': 0.18888888888888888, 'fraction_numerical': 0.0, 'mean_word_length': 3.824404761904762, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 13, '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': '7581450', 'n_tokens_mistral': 492, 'n_tokens_neox': 483, 'n_words': 81}