diff --git a/packages/mosaic/src/commands/fleet-agent-crud-command.spec.ts b/packages/mosaic/src/commands/fleet-agent-crud-command.spec.ts index 463fb36..787849a 100644 --- a/packages/mosaic/src/commands/fleet-agent-crud-command.spec.ts +++ b/packages/mosaic/src/commands/fleet-agent-crud-command.spec.ts @@ -4,7 +4,6 @@ import { join } from 'node:path'; import { Command } from 'commander'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { fleetAgentMutationExitCode } from './fleet-agent-crud-command.js'; -import { applyPreparedAgentEnvironmentProjection } from '../fleet/generated-env-boundary.js'; import { registerFleetCommand, type FleetCommandDeps } from './fleet.js'; const roster = ` @@ -389,25 +388,20 @@ describe('mosaic fleet local roster mutations', (): void => { const agentsDir = join(home, 'fleet', 'agents'); const captured = output(); - try { - await program(home, { - projectionApplier: async (prepared): Promise => { - await chmod(agentsDir, 0o500); - return applyPreparedAgentEnvironmentProjection(prepared); - }, - }).parseAsync([ - 'node', - 'mosaic', - 'fleet', - 'create', - '--expected-generation', - '7', - '--agent', - JSON.stringify(agent), - ]); - } finally { - await chmod(agentsDir, 0o700); - } + await program(home, { + projectionApplier: async (): Promise => { + throw new Error('injected projection failure'); + }, + }).parseAsync([ + 'node', + 'mosaic', + 'fleet', + 'create', + '--expected-generation', + '7', + '--agent', + JSON.stringify(agent), + ]); expect(JSON.parse(captured.lines.join('\n'))).toMatchObject({ applied: false, @@ -525,17 +519,12 @@ describe('mosaic fleet local roster mutations', (): void => { JSON.stringify(agent), ]); - try { - captured.lines.length = 0; - await program(home, { - projectionApplier: async (prepared): Promise => { - await chmod(agentsDir, 0o500); - return applyPreparedAgentEnvironmentProjection(prepared); - }, - }).parseAsync(['node', 'mosaic', 'fleet', 'delete', 'coder0', '--expected-generation', '8']); - } finally { - await chmod(agentsDir, 0o700); - } + captured.lines.length = 0; + await program(home, { + projectionApplier: async (): Promise => { + throw new Error('injected projection failure'); + }, + }).parseAsync(['node', 'mosaic', 'fleet', 'delete', 'coder0', '--expected-generation', '8']); expect(JSON.parse(captured.lines.pop() ?? '')).toMatchObject({ applied: false,