13 lines
442 B
TypeScript
13 lines
442 B
TypeScript
import { expect, it } from "vitest";
|
|
import { createNitroBundle, parseNitroBundle } from "./nitro-builder";
|
|
|
|
it("honors an explicit decompression limit for imported bundles", () => {
|
|
const bundle = createNitroBundle(
|
|
{ name: "chair", value: "a".repeat(4096) },
|
|
Buffer.from("png"),
|
|
"chair",
|
|
);
|
|
expect(() => parseNitroBundle(bundle, { maxOutputLength: 1024 })).toThrow();
|
|
expect(parseNitroBundle(bundle).json.name).toBe("chair");
|
|
});
|