Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { describe, expect, it } from "vitest";
import { throwIfAborted } from "./abort.js";
describe("throwIfAborted", () => {
it("does nothing when the signal is missing or not aborted", () => {
expect(() => throwIfAborted()).not.toThrow();
expect(() => throwIfAborted(new AbortController().signal)).not.toThrow();
});
it("throws a standard AbortError when the signal is aborted", () => {
const controller = new AbortController();
controller.abort();
expect(() => throwIfAborted(controller.signal)).toThrowError(
expect.objectContaining({
name: "AbortError",
message: "Operation aborted",
}),
);
});
});
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland