mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 18:25:24 +00:00
Bundle: added another message to Messages
This commit is contained in:
@@ -22,7 +22,7 @@ describe("Bundle", () => {
|
|||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
expect(() => new Bundle()).toThrowError(
|
expect(() => new Bundle()).toThrowError(
|
||||||
Error,
|
Error,
|
||||||
"Cannot build Bundle. MimeType is missing",
|
Messages.BUNDLE.MIME_TYPE_MISSING,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default class Bundle {
|
|||||||
|
|
||||||
constructor(public mimeType: `${Mime.type}/${Mime.subtype}`) {
|
constructor(public mimeType: `${Mime.type}/${Mime.subtype}`) {
|
||||||
if (!mimeType) {
|
if (!mimeType) {
|
||||||
throw new Error("Cannot build Bundle. MimeType is missing");
|
throw new Error(Messages.BUNDLE.MIME_TYPE_MISSING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ export const MODELS = {
|
|||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const BUNDLE = {
|
export const BUNDLE = {
|
||||||
|
MIME_TYPE_MISSING: "Cannot build Bundle. MimeType is missing",
|
||||||
CLOSED: "Cannot add file. Bundle is closed.",
|
CLOSED: "Cannot add file. Bundle is closed.",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user