Merge pull request #17202 from Snuffleupagus/node-ci-latest
Also test the latest Node.js version in GitHub Actions
This commit is contained in:
commit
71a6c749d0
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -9,8 +9,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [18, lts/*]
|
node-version: [18, lts/*, latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
@ -26,6 +26,7 @@ import {
|
|||||||
AnnotationFieldFlag,
|
AnnotationFieldFlag,
|
||||||
AnnotationFlag,
|
AnnotationFlag,
|
||||||
AnnotationType,
|
AnnotationType,
|
||||||
|
isNodeJS,
|
||||||
OPS,
|
OPS,
|
||||||
RenderingIntentFlag,
|
RenderingIntentFlag,
|
||||||
stringToBytes,
|
stringToBytes,
|
||||||
@ -34,6 +35,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
CMAP_URL,
|
CMAP_URL,
|
||||||
createIdFactory,
|
createIdFactory,
|
||||||
|
getNodeVersion,
|
||||||
STANDARD_FONT_DATA_URL,
|
STANDARD_FONT_DATA_URL,
|
||||||
XRefMock,
|
XRefMock,
|
||||||
} from "./test_utils.js";
|
} from "./test_utils.js";
|
||||||
@ -2207,6 +2209,12 @@ describe("annotation", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should compress and save text", async function () {
|
it("should compress and save text", async function () {
|
||||||
|
if (isNodeJS && getNodeVersion().major === 21) {
|
||||||
|
pending(
|
||||||
|
"CompressionStream behaves differently in Node.js 21, " +
|
||||||
|
"compared to Firefox, Chrome, and Node.js 18/20."
|
||||||
|
);
|
||||||
|
}
|
||||||
const textWidgetRef = Ref.get(123, 0);
|
const textWidgetRef = Ref.get(123, 0);
|
||||||
const xref = new XRefMock([
|
const xref = new XRefMock([
|
||||||
{ ref: textWidgetRef, data: textWidgetDict },
|
{ ref: textWidgetRef, data: textWidgetDict },
|
||||||
|
@ -144,11 +144,22 @@ function createIdFactory(pageIndex) {
|
|||||||
return page._localIdFactory;
|
return page._localIdFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getNodeVersion() {
|
||||||
|
if (!isNodeJS) {
|
||||||
|
throw new Error("getNodeVersion - only valid in Node.js environments.");
|
||||||
|
}
|
||||||
|
const [major, minor, patch] = process.versions.node
|
||||||
|
.split(".")
|
||||||
|
.map(parseFloat);
|
||||||
|
return { major, minor, patch };
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
buildGetDocumentParams,
|
buildGetDocumentParams,
|
||||||
CMAP_URL,
|
CMAP_URL,
|
||||||
createIdFactory,
|
createIdFactory,
|
||||||
DefaultFileReaderFactory,
|
DefaultFileReaderFactory,
|
||||||
|
getNodeVersion,
|
||||||
STANDARD_FONT_DATA_URL,
|
STANDARD_FONT_DATA_URL,
|
||||||
TEST_PDFS_PATH,
|
TEST_PDFS_PATH,
|
||||||
XRefMock,
|
XRefMock,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user