mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 19:25:23 +00:00
Fixed tests, added tests, fixed ducked up things
This commit is contained in:
@@ -43,11 +43,27 @@ describe("Bundle", () => {
|
||||
expect(bundle.getAsStream()).toBeInstanceOf(Stream);
|
||||
});
|
||||
|
||||
it("should freeze the bundle when using 'getAsStream'", () => {
|
||||
bundle.getAsStream();
|
||||
expect(bundle.isFrozen).toBe(true);
|
||||
});
|
||||
|
||||
it("should return a buffer with 'getAsBuffer'", async () => {
|
||||
addEmptyFilesToBundle(bundle);
|
||||
|
||||
expect(await bundle.getAsBuffer()).toBeInstanceOf(Buffer);
|
||||
});
|
||||
|
||||
it("should freeze the bundle when using 'getAsBuffer'", async () => {
|
||||
await bundle.getAsBuffer();
|
||||
expect(bundle.isFrozen).toBe(true);
|
||||
});
|
||||
|
||||
it("freezables should expose freezable and bundle itself to be frozen", () => {
|
||||
const [bundle, freeze] = Bundle.freezable("any/any");
|
||||
freeze();
|
||||
expect(bundle.isFrozen).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
function addEmptyFilesToBundle(bundle: Bundle) {
|
||||
|
||||
Reference in New Issue
Block a user