sessions-root.spec.ts 820 B

1234567891011121314151617181920
  1. /**
  2. * Pins the launcher side of the shared-session-store contract: `dsh` defaults
  3. * its opaque `SESSIONS_ROOT_KEY` boot-slot value to `DSH_HOME/sessions`. The
  4. * plugin side — the slot treated as opaque, explicit config winning, and a
  5. * project-local fallback with no globality assumption — is pinned by
  6. * `packages/examples/tui-demo/tests/tui-agent.spec.ts`.
  7. */
  8. import { join, resolve } from 'node:path'
  9. import { afterEach, describe, expect, it, vi } from 'vitest'
  10. import { launcherSessionsRoot } from '../src/tui.ts'
  11. afterEach(() => vi.unstubAllEnvs())
  12. describe('launcherSessionsRoot', () => {
  13. it('defaults the boot slot to sessions under DSH_HOME', () => {
  14. vi.stubEnv('DSH_HOME', '/tmp/dsh-slot-home')
  15. expect(launcherSessionsRoot()).toBe(resolve(join('/tmp/dsh-slot-home', 'sessions')))
  16. })
  17. })