Files
archived-orca/src/cli/handlers/plugin-runtime.test.ts
T
Neil e9be993f47 cli: add orca plugin dev load/unload/reload, list, logs, enable and disable (#36288)
* cli: add orca plugin dev load/unload/reload, list, logs, enable and disable

* cli: move plugin handler groups out of the manifest
2026-10-30 01:28:26 -07:00

19 lines
684 B
TypeScript

import { describe, expect, it } from 'vitest'
import { approvalRerunCommand } from './plugin-runtime'
describe('approvalRerunCommand', () => {
it('re-runs the exact command with only the approve flag replaced', () => {
expect(
approvalRerunCommand(
['plugin', 'dev', 'load', '/tmp/my plugin', '--approve', 'ap1-old', '--json'],
'ap1-new'
)
).toBe(
`orca plugin dev load ${process.platform === 'win32' ? '"/tmp/my plugin"' : "'/tmp/my plugin'"} --json --approve ap1-new`
)
expect(approvalRerunCommand(['plugin', 'enable', 'acme.x', '--approve=ap1-a'], 'ap1-b')).toBe(
'orca plugin enable acme.x --approve ap1-b'
)
})
})