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.

900 B
Raw Blame
import { afterEach, describe, expect, it } from 'vitest'
import {
  cleanupConnectorHarnesses,
  createConnectorHarness
} from './connector-server-harness.test-fixture.js'
import { loadCheckpoint, saveCheckpoint } from './discord-gateway-checkpoint.js'

afterEach(cleanupConnectorHarnesses)

describe('Discord gateway checkpoint', () => {
  it('resumes where the last commit left off', async () => {
    const { database } = await createConnectorHarness()
    expect(await loadCheckpoint(database)).toBeNull()
    for (const sequence of [4, 5]) {
      const checkpoint = { sessionId: 'session-1', resumeURL: 'wss://gateway.example', sequence }
      await database.transaction((transaction) => saveCheckpoint(transaction, checkpoint))
    }
    expect(await loadCheckpoint(database)).toEqual({
      sessionId: 'session-1',
      resumeURL: 'wss://gateway.example',
      sequence: 5
    })
  })
})