diff --git a/specs/PKPass.spec.cjs b/specs/PKPass.spec.cjs index 803a07c..78b54d3 100644 --- a/specs/PKPass.spec.cjs +++ b/specs/PKPass.spec.cjs @@ -989,8 +989,6 @@ describe("PKPass", () => { const buffers = pkpass.getAsRaw(); - console.log(buffers, modelFiles); - for (let fileName of Object.keys(buffers)) { /** Skipping generated files */ if ( @@ -1006,6 +1004,35 @@ describe("PKPass", () => { } }); + it("should throw an error if a model folder doesn't exist", () => { + expect(() => + PKPass.from({ + model: path.resolve( + __dirname, + "this/model/doesnt/exists.pass", + ), + }), + ).rejects.toBeInstanceOf(Error); + }); + + it("should enforce .pass model extension", async () => { + expect( + async () => + await PKPass.from({ + model: path.resolve( + __dirname, + "../examples/models/examplePass", + ), + certificates: { + signerCert: SIGNER_CERT, + signerKey: SIGNER_KEY, + signerKeyPassphrase: SIGNER_KEY_PASSPHRASE, + wwdr: WWDR, + }, + }), + ).not.toThrow(); + }); + it("should silently filter out manifest and signature files", async () => { pkpass = await PKPass.from({ model: path.resolve(__dirname, EXAMPLE_PATH_RELATIVE),