mirror of
https://github.com/morluto/rea
synced 2026-10-27 06:33:32 -04:00
26 lines
830 B
TypeScript
26 lines
830 B
TypeScript
import { expect, it } from "vitest";
|
|
|
|
import { ArtifactReaderFailure } from "./ArtifactReader.js";
|
|
import { translateArtifactFailure } from "./ArtifactOperationFailure.js";
|
|
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
|
|
it.each(["capacity", "file-size", "memory"] as const)(
|
|
"retains the producing %s limit through public error projection",
|
|
(boundary) => {
|
|
const failure = new ArtifactReaderFailure(
|
|
"limit",
|
|
"The specific reader allowance was exceeded",
|
|
{ boundary },
|
|
);
|
|
const result = projectAnalysisError(
|
|
translateArtifactFailure("inventory_artifact", failure),
|
|
);
|
|
expect(result).toMatchObject({
|
|
code: "truncated",
|
|
retryable: false,
|
|
message: failure.message,
|
|
details: { boundary, detail: failure.message },
|
|
});
|
|
},
|
|
);
|