From 10e51abce348d42be3bc68d4ec9ee6c2b3f2ca76 Mon Sep 17 00:00:00 2001 From: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Date: Mon, 21 Sep 2026 20:25:13 -0300 Subject: [PATCH] fix(test): align Vitest collectors and lifecycle data loading --- .../__tests__/fitness-table-hygiene-11503.test.ts | 12 ++++-------- tests/unit/dashboard/ComboSortSelect.test.tsx | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/open-sse/services/autoCombo/__tests__/fitness-table-hygiene-11503.test.ts b/open-sse/services/autoCombo/__tests__/fitness-table-hygiene-11503.test.ts index 87abe73f9bb7..f075a2d53599 100644 --- a/open-sse/services/autoCombo/__tests__/fitness-table-hygiene-11503.test.ts +++ b/open-sse/services/autoCombo/__tests__/fitness-table-hygiene-11503.test.ts @@ -16,20 +16,16 @@ * An id the table does not know resolves to the wildcard baseline 0.5 — the documented * neutral for "no evidence", never a quality claim. */ -import { readFileSync } from "node:fs"; -import { fileURLToPath } from "node:url"; import { describe, it, expect } from "vitest"; +import lifecycleData from "../../../../config/quality/model-lifecycle.json"; import { getStaticFitnessTableScore } from "../taskFitness"; import { REGISTRY } from "../../../config/providers/index.ts"; const TASK_TYPES = ["coding", "review", "planning", "analysis", "debugging", "documentation"]; -const lifecycle = JSON.parse( - readFileSync( - fileURLToPath(new URL("../../../../config/quality/model-lifecycle.json", import.meta.url)), - "utf8" - ) -) as { retired: Record }; +// Import data through the runner instead of letting Vite rewrite new URL(...) +// as a browser asset URL in the jsdom lane. +const lifecycle = lifecycleData as { retired: Record }; const retiredIds = new Set( Object.entries(lifecycle.retired) diff --git a/tests/unit/dashboard/ComboSortSelect.test.tsx b/tests/unit/dashboard/ComboSortSelect.test.tsx index 60a07b0e6912..caeca8cb89ff 100644 --- a/tests/unit/dashboard/ComboSortSelect.test.tsx +++ b/tests/unit/dashboard/ComboSortSelect.test.tsx @@ -1,5 +1,4 @@ -import "../../_setup/jsdomGlobal.ts"; -import { describe, it } from "node:test"; +import { describe, it } from "vitest"; import assert from "node:assert/strict"; import { render, screen, fireEvent } from "@testing-library/react"; import { ComboSortSelect } from "@/app/(dashboard)/dashboard/combos/ComboSortSelect";