test(daytona): retain explicit destroy failure coverage

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Dotta 2026-09-11 17:22:01 -05:00
parent 8ab7aa7efd
commit 30e3738c00
1 changed files with 2 additions and 1 deletions

View File

@ -1621,7 +1621,8 @@ describe("Daytona sandbox provider plugin", () => {
it("deletes the session at destroy even when the sandbox delete throws", async () => {
process.env.DAYTONA_API_KEY = "host-key";
const sandbox = createMockSandbox();
mockGet.mockResolvedValue(sandbox);
sandbox.delete.mockRejectedValueOnce(new Error("delete failed"));
mockGet.mockResolvedValue(sandbox);
await plugin.definition.onEnvironmentExecute?.(sessionExecParams());
const sessionId = sandbox.process.createSession.mock.calls[0]![0] as string;