Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { describe, expect, it, vi } from "vitest";
import { runBestEffortCleanup } from "./non-fatal-cleanup.js";
describe("runBestEffortCleanup", () => {
it("returns the cleanup result when the cleanup succeeds", async () => {
await expect(
runBestEffortCleanup({
cleanup: async () => 7,
}),
).resolves.toBe(7);
});
it("swallows cleanup failures and reports them through onError", async () => {
const onError = vi.fn();
const error = new Error("cleanup failed");
await expect(
runBestEffortCleanup({
cleanup: async () => {
throw error;
},
onError,
}),
).resolves.toBeUndefined();
expect(onError).toHaveBeenCalledWith(error);
});
});
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland