Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

740 B
Raw Blame
import { describe, expect, it } from 'vitest'
import { BoundedLiveFreezeHistory } from './live-freeze-bounded-history.mjs'

describe('BoundedLiveFreezeHistory', () => {
  it('retains the newest entries in insertion order and counts the full run', () => {
    const history = new BoundedLiveFreezeHistory(3)

    for (let value = 1; value <= 7; value += 1) {
      history.add(value)
    }

    expect(history.values()).toEqual([5, 6, 7])
    expect(history.retainedCount).toBe(3)
    expect(history.totalCount).toBe(7)
  })

  it('rejects invalid retention limits', () => {
    expect(() => new BoundedLiveFreezeHistory(0)).toThrow('positive integer')
    expect(() => new BoundedLiveFreezeHistory(1.5)).toThrow('positive integer')
  })
})