refactor(FN-1242): migrate desktop vitest config to project-based setup

- Replace environmentMatchGlobs with explicit Vitest test.projects entries for desktop and desktop-renderer suites
- Keep desktop core tests on the threads pool and renderer tests in a jsdom-targeted project
- Increase the batch-import 429 retry test timeout from 30s to 60s to reduce CI flakiness
This commit is contained in:
gsxdsm
2026-04-08 09:17:23 -07:00
parent ebb8e63274
commit f0878ce7b6
2 changed files with 17 additions and 4 deletions

View File

@@ -4143,7 +4143,7 @@ describe("POST /github/issues/batch-import", () => {
expect(res.body.results[0].error).toContain("rate limit");
expect(res.body.results[0].retryAfter).toBe(1);
expect(fetchSpy.mock.calls.length).toBeGreaterThanOrEqual(4);
}, 30000); // Retry path can exceed 15s in CI/load-constrained environments
}, 60000); // Retry path can exceed 30s in CI/load-constrained environments
it("processes issues sequentially (not parallel)", async () => {
vi.useFakeTimers();

View File

@@ -4,13 +4,26 @@ const maxWorkers = Number.parseInt(process.env.VITEST_MAX_WORKERS ?? "16", 10);
export default defineConfig({
test: {
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
environmentMatchGlobs: [["src/renderer/**", "jsdom"]],
pool: "threads",
testTimeout: 30_000,
hookTimeout: 30_000,
maxWorkers,
fileParallelism: true,
passWithNoTests: true,
projects: [
{
test: {
name: "desktop",
include: ["src/__tests__/**/*.test.ts"],
pool: "threads",
},
},
{
test: {
name: "desktop-renderer",
include: ["src/renderer/**/*.test.ts", "src/renderer/**/*.test.tsx"],
environment: "jsdom",
},
},
],
},
});