CI: bump from node 18.x to 22.x [#606] (#614)

* CI: bump from node 18.x to 22.x [#606]

* update cloudflare wrangler version

* fix tests for node 22
This commit is contained in:
Brandon Liu
2025-12-01 17:02:39 +08:00
committed by GitHub
parent ec103efdff
commit 4dc2daad8a
4 changed files with 349 additions and 379 deletions

View File

@@ -17,7 +17,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18.x node-version: 22.x
- run: cd js && npm ci && npm run build - run: cd js && npm ci && npm run build
- run: echo "VITE_GIT_SHA=$(git rev-parse --short HEAD)" >> app/.env - run: echo "VITE_GIT_SHA=$(git rev-parse --short HEAD)" >> app/.env
- run: cd app && npm ci && npm run check && npm run build - run: cd app && npm ci && npm run check && npm run build
@@ -45,7 +45,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18.x node-version: 22.x
- run: python .github/check_examples.py - run: python .github/check_examples.py
- run: cd js && npm ci && npm test - run: cd js && npm ci && npm test
- run: cd js && npm run biome-check - run: cd js && npm run biome-check

View File

@@ -418,15 +418,21 @@ test("pmtiles get TileJSON", async () => {
assert.equal("2", tilejson.version); assert.equal("2", tilejson.version);
}); });
const originalUserAgent = navigator.userAgent;
describe("user agent", async () => { describe("user agent", async () => {
beforeEach(() => { beforeEach(() => {
// @ts-ignore Object.defineProperty(globalThis.navigator, "userAgent", {
global.navigator = { userAgent: "Windows Chrome" }; value: "Windows Chrome",
configurable: true,
});
}); });
afterEach(() => { afterEach(() => {
// @ts-ignore Object.defineProperty(globalThis.navigator, "userAgent", {
global.navigator.userAgent = undefined; value: originalUserAgent,
configurable: true,
});
}); });
it("works around caching bug on chrome on windows", async () => { it("works around caching bug on chrome on windows", async () => {

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
"@cloudflare/workers-types": "^4.20230518.0", "@cloudflare/workers-types": "^4.20230518.0",
"tsx": "^4.19.3", "tsx": "^4.19.3",
"typescript": "^4.8.4", "typescript": "^4.8.4",
"wrangler": "^4.16.0" "wrangler": "^4.51.0"
}, },
"private": true, "private": true,
"scripts": { "scripts": {