Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

700 B
Raw Blame
// Runs before every test file (vitest.config.ts, setupFiles).
//
// The composer lays its drafts down in a module-level shelf when it unmounts
// (lib/chat-drafts.ts). Testing Library unmounts after every test, so without
// this the next test would open with the text of the last one.
//
// The page memory (stores/pageMemoryStore.ts, C22) is the same kind of
// shelf for Models and Settings: it outlives an unmount on purpose, so every
// test starts with the state of a fresh session.
import { beforeEach } from 'vitest'
import { clearChatDrafts } from './lib/chat-drafts'
import { resetPageMemory } from './stores/pageMemoryStore'

beforeEach(() => {
  clearChatDrafts()
  resetPageMemory()
})