Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions skills/outline-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ ol auth logout # Clear saved credentials
```bash
ol update # Update CLI to latest version
ol update --check # Check for updates without installing, show channel
ol update --check --json # Check for updates as a JSON envelope
ol update --check --ndjson # Check for updates as NDJSON output
ol update --channel # Show current update channel
ol update switch --stable # Switch to stable release channel
ol update switch --pre-release # Switch to pre-release (next) channel
Expand Down
41 changes: 41 additions & 0 deletions src/__tests__/update-surface.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Command } from 'commander'
import { describe, expect, it, vi } from 'vitest'
import { registerUpdateCommand } from '../commands/update/index.js'

// Stub out config + spinner — this test only cares about the command surface
// (subcommand names + flags) wired up via the real cli-core, so a bump to
// cli-core can't silently change `ol update`'s public CLI shape.
vi.mock('../lib/config.js', () => ({
getConfigPath: () => '/tmp/outline-cli-test/config.json',
}))

vi.mock('../lib/spinner.js', () => ({
withSpinner: vi.fn((_opts: unknown, fn: () => Promise<unknown>) => fn()),
}))

describe('ol update command surface (integration with real cli-core)', () => {
it('exposes `update` with --check and --channel flags', () => {
const program = new Command()
registerUpdateCommand(program)

const update = program.commands.find((c) => c.name() === 'update')
expect(update).toBeDefined()

const longs = update?.options.map((o) => o.long) ?? []
expect(longs).toContain('--check')
expect(longs).toContain('--channel')
})

it('exposes `update switch` with --stable and --pre-release flags', () => {
const program = new Command()
registerUpdateCommand(program)

const update = program.commands.find((c) => c.name() === 'update')
const switchCmd = update?.commands.find((c) => c.name() === 'switch')
expect(switchCmd).toBeDefined()

const longs = switchCmd?.options.map((o) => o.long) ?? []
expect(longs).toContain('--stable')
expect(longs).toContain('--pre-release')
})
})
Loading
Loading