From 8441aa8c7b8fca900dae3f5fb012c49ba7285b78 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Tue, 2 Jun 2026 00:41:32 +0200 Subject: [PATCH 1/2] test: clear mock history between tests for vitest 4 vitest 4 changed restoreAllMocks() to no longer reset vi.fn() call history (only restores spies), causing mock call counts to accumulate across tests. Enable clearMocks to restore per-test isolation. --- vitest.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vitest.config.ts b/vitest.config.ts index b10e399..1833af1 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -2,6 +2,7 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { + clearMocks: true, coverage: { provider: "v8", include: ["src/**/*.ts"], From 104fe354304c429efa29bfc2a51edac3ae48b515 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Tue, 2 Jun 2026 01:04:17 +0200 Subject: [PATCH 2/2] ci: drop Node 18 (EOL); vitest 4 requires Node 20+ vitest 4 uses node:util styleText, available only on Node 20.12+. Node 18 reached end-of-life in April 2025. Bump engines and CI matrix to Node 20/22. --- .github/workflows/ci.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eed76dd..607c65a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: [self-hosted, Linux, X64] strategy: matrix: - node-version: [18, 20, 22] + node-version: [20, 22] steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 diff --git a/package.json b/package.json index d78b44d..8a39c02 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "url": "https://github.com/GeiserX/ghost-github-portfolio/issues" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "dependencies": { "commander": "^13.1.0",