mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 13:25:19 +00:00
Improved tests for reading model folder
This commit is contained in:
@@ -989,8 +989,6 @@ describe("PKPass", () => {
|
|||||||
|
|
||||||
const buffers = pkpass.getAsRaw();
|
const buffers = pkpass.getAsRaw();
|
||||||
|
|
||||||
console.log(buffers, modelFiles);
|
|
||||||
|
|
||||||
for (let fileName of Object.keys(buffers)) {
|
for (let fileName of Object.keys(buffers)) {
|
||||||
/** Skipping generated files */
|
/** Skipping generated files */
|
||||||
if (
|
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 () => {
|
it("should silently filter out manifest and signature files", async () => {
|
||||||
pkpass = await PKPass.from({
|
pkpass = await PKPass.from({
|
||||||
model: path.resolve(__dirname, EXAMPLE_PATH_RELATIVE),
|
model: path.resolve(__dirname, EXAMPLE_PATH_RELATIVE),
|
||||||
|
|||||||
Reference in New Issue
Block a user