def METHOD_NAME(config: Config, memory_item: MemoryItem):
    index = JSONFileMemory(config)
    index.add(memory_item)
    try:
        assert index.file_path.exists(), "index was not saved to file"
        assert len(index) == 1, f"index constains {len(index)} items instead of 1"
        assert index.memories[0] == memory_item, "item in index != added mock item"
    except AssertionError as e:
        raise ValueError(f"Setting up for load_index test failed: {e}")
    index.memories = []
    index.load_index()
    assert len(index) == 1
    assert index.memories[0] == memory_item