mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-24 09:08:07 +02:00
Enable the "checks that the viewer re-exports the expected API functionality" unit-test in Node.js
By also running `gulp generic-legacy` before the Node.js unit-tests, we can enable one more test-case in Node.js environments.
This commit is contained in:
parent
850e605e36
commit
0790d94674
2 changed files with 32 additions and 21 deletions
|
@ -22,7 +22,6 @@ import {
|
|||
FeatureTest,
|
||||
ImageKind,
|
||||
InvalidPDFException,
|
||||
isNodeJS,
|
||||
normalizeUnicode,
|
||||
OPS,
|
||||
PasswordResponses,
|
||||
|
@ -129,13 +128,20 @@ describe("pdfjs_api", function () {
|
|||
|
||||
describe("web_pdfjsLib", function () {
|
||||
it("checks that the viewer re-exports the expected API functionality", async function () {
|
||||
if (isNodeJS) {
|
||||
pending("loadScript is not supported in Node.js.");
|
||||
}
|
||||
const apiPath = "../../build/generic/build/pdf.mjs";
|
||||
await import(apiPath);
|
||||
// Load the API globally, as the viewer does.
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
await import(
|
||||
typeof PDFJSDev !== "undefined" && PDFJSDev.test("LIB")
|
||||
? "../../../generic-legacy/build/pdf.mjs"
|
||||
: "../../build/generic/build/pdf.mjs"
|
||||
);
|
||||
|
||||
const webPdfjsLib = await import("../../web/pdfjs.js");
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
const webPdfjsLib = await import(
|
||||
typeof PDFJSDev !== "undefined" && PDFJSDev.test("LIB")
|
||||
? "../../../../web/pdfjs.js"
|
||||
: "../../web/pdfjs.js"
|
||||
);
|
||||
|
||||
expect(Object.keys(webPdfjsLib).sort()).toEqual(
|
||||
Object.keys(expectedAPI).sort()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue