Files
wpep/tools/gp/main_test.ts
T

49 lines
1.3 KiB
TypeScript

import { PFile, PFiles } from "./file.ts";
import { DocuBuilder, IndexBuilder } from "./pdf_builder/builder.ts";
import { PDFParse } from "pdf-parse";
// Deno.test("PFiles initialization", () => {
// const pfiles = new PFiles("./mobile_src");
// console.log(pfiles);
// });
// Deno.test("PDF generate", async () => {
// const builder = new DocuBuilder();
// try {
// await builder.with_browser();
// const cfg = JSON.parse(await Deno.readTextFile("config.json"));
// for (const config of cfg.settings) {
// console.debug(`Processing config: ${JSON.stringify(config)}`);
// builder.with_files_sync(config.journal.from_directory);
// builder.as_html_page();
// await builder.build_as_pdf(config.playwright);
// }
// } finally {
// await builder.close_browser();
// }
// });
// Deno.test({
// name: "IndexBuilder test",
// sanitizeOps: false,
// sanitizeResources: false,
// async fn() {
// },
// });
Deno.test({
name: "OpenPGPSigner test",
sanitizeOps: false,
sanitizeResources: false,
async fn() {
const { OpenPGPSigner } = await import("./pdf_builder/builder.ts");
const signer = new OpenPGPSigner(
"./outputs/mobile.pdf",
"./private_key.asc",
"./outputs/mobile.pdf.sig",
);
await signer.sign();
},
});