perf(test): run dashboard src tests in node env, app tests in jsdom
The dashboard backend (Express routes, services) lives under src/ and is pure Node logic, but every test was paying for jsdom env init plus full CSS-import processing. Split via environmentMatchGlobs so app/** keeps jsdom (React UI) and src/** runs in node by default. Two src tests opt back into jsdom: - status-bar.test.ts uses window.matchMedia. - proxy-routes.test.ts asserts on DOMException constructor.name, which jsdom reports as "AbortError" but node reports as "DOMException". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
// @vitest-environment jsdom
|
||||
// Uses DOMException("Aborted", "AbortError") whose constructor.name behaves
|
||||
// differently in node (resolves to "DOMException") vs jsdom ("AbortError"),
|
||||
// which the proxy error classifier asserts on.
|
||||
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
||||
import { EventEmitter } from "node:events";
|
||||
import { request, get } from "../test-request.js";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// @vitest-environment jsdom
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { StatusBarManager } from "../plugins/status-bar.js";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user