1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Run the PDF.js-viewer API unit-test in Node.js environments (PR 16592 follow-up)

It occurred to me that we can actually run this unit-test in Node.js environments by making use of the preprocessor to stub out the browser globals there.
This commit is contained in:
Jonas Jenwald 2023-06-26 09:30:13 +02:00
parent ccb72073b0
commit 5f5db4b160
4 changed files with 15 additions and 5 deletions

View file

@ -18,8 +18,6 @@
import "../external/webL10n/l10n.js";
import { getL10nFallback } from "./l10n_utils.js";
const { webL10n } = document;
const PARTIAL_LANG_CODES = {
en: "en-US",
es: "es-ES",
@ -47,6 +45,7 @@ function fixupLangCode(langCode) {
*/
class GenericL10n {
constructor(lang) {
const { webL10n } = document;
this._lang = lang;
this._ready = new Promise((resolve, reject) => {
webL10n.setLanguage(fixupLangCode(lang), () => {