From 729e3190ebcf8ad1ce5a1f390d9cefa609055ff5 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 16 Nov 2024 11:50:51 +0100 Subject: [PATCH] Fix a couple of bugs affecting benchmarking - Ensure that `pdfjsTestingUtils` is available when running benchmarking, since that shouldn't be done in TESTING-mode. - Exclude the `test/stats/results/` folder from linting, since it'll contain *generated* JSON-files. --- .prettierignore | 1 + .stylelintignore | 1 + eslint.config.mjs | 1 + src/pdf.js | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index e33594bd7..90371a116 100644 --- a/.prettierignore +++ b/.prettierignore @@ -6,6 +6,7 @@ external/bcmaps/ external/builder/fixtures/ external/builder/fixtures_babel/ external/quickjs/ +test/stats/results/ test/tmp/ test/pdfs/ web/locale/ diff --git a/.stylelintignore b/.stylelintignore index e33594bd7..90371a116 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -6,6 +6,7 @@ external/bcmaps/ external/builder/fixtures/ external/builder/fixtures_babel/ external/quickjs/ +test/stats/results/ test/tmp/ test/pdfs/ web/locale/ diff --git a/eslint.config.mjs b/eslint.config.mjs index e0c2b8b01..2956a79ec 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -35,6 +35,7 @@ export default [ "external/builder/fixtures_babel/", "external/quickjs/", "external/openjpeg/", + "test/stats/results/", "test/tmp/", "test/pdfs/", "web/locale/", diff --git a/src/pdf.js b/src/pdf.js index 2febc4227..ecb6606dd 100644 --- a/src/pdf.js +++ b/src/pdf.js @@ -80,7 +80,7 @@ const pdfjsVersion = const pdfjsBuild = typeof PDFJSDev !== "undefined" ? PDFJSDev.eval("BUNDLE_BUILD") : void 0; -if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) { +if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING || GENERIC")) { globalThis.pdfjsTestingUtils = { HighlightOutliner, };