wasm-rquickjs-cli 0.5.3

Tool for wrapping JavaScript modules as WebAssembly components using the QuickJS engine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import assert from "assert";
import pdf from "pdf-parse";

export const run = async () => {
  await assert.rejects(
    () => pdf(Buffer.from("This is not a valid PDF document", "utf8")),
    (error) => {
      assert.ok(error instanceof Error, "Expected an Error instance");
      return true;
    },
  );

  return "PASS: invalid PDF input rejects with an error";
};