Added better freezing check

This commit is contained in:
Alexander Cerutti
2023-04-19 22:25:32 +02:00
parent 687caf727b
commit cc2226930a

View File

@@ -388,13 +388,29 @@ describe("PKPass", () => {
expect(backFields.length).toBe(0); expect(backFields.length).toBe(0);
}); });
it("pkpass should get frozen once an export is done", () => { describe("pkpass should get frozen once an export is done", () => {
it("getAsRaw", () => {
pkpass.getAsRaw(); pkpass.getAsRaw();
/** We might want to test all the methods, but methods might change... so should we? */ /** We might want to test all the methods, but methods might change... so should we? */
expect(() => pkpass.localize("en", { a: "b" })).toThrowError(); expect(() => pkpass.localize("en", { a: "b" })).toThrowError();
}); });
it("getAsBuffer", () => {
pkpass.getAsBuffer();
/** We might want to test all the methods, but methods might change... so should we? */
expect(() => pkpass.localize("en", { a: "b" })).toThrowError();
});
it("getAsStream", () => {
pkpass.getAsStream();
/** We might want to test all the methods, but methods might change... so should we? */
expect(() => pkpass.localize("en", { a: "b" })).toThrowError();
});
});
describe("localize and languages", () => { describe("localize and languages", () => {
it("should delete a language, all of its translations and all of its files, when null is passed as parameter", () => { it("should delete a language, all of its translations and all of its files, when null is passed as parameter", () => {
pkpass.addBuffer("it.lproj/icon@3x.png", Buffer.alloc(0)); pkpass.addBuffer("it.lproj/icon@3x.png", Buffer.alloc(0));