Skip to content

Commit e0fe7d3

Browse files
test(ui-e2e): delete the vacuous MSW worker test and the unused msw declarations (#26032)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DX3GDGkbVgX1bfDK2kArSWv)_ Part of #25914 — the in-scope half (triage 2026-10-24: "delete the vacuous MSW test"). The card stays open for the items left to the maintainer, listed at the end. Clause-②: no Metadata-protocol: none ## Summary Re-measured on `main` 88531fa: - `ui/apps/console/public/mockServiceWorker.js` does not exist, so `ui/e2e/console-rendering.spec.ts` "should include the MSW service worker in the build output" always took its silent `return` (SPA fallback served `text/html`) and asserted nothing. **Deleted.** - objectui#13453 did not retire `msw`: it was still declared in `ui/package.json` (devDependency plus the `"msw": { "workerDirectory": ["public"] }` block), `ui/packages/plugin-form` and `ui/packages/plugin-grid` (devDependencies). `git grep` for `'msw'`, `msw/*`, `setupServer`, `setupWorker` outside the lockfile finds no importer in code; the only hit is the example snippet in `ui/skills/objectui/guides/testing.md`, which is consumer guidance and imports nothing here. **Removed**, together with the generated worker `ui/public/mockServiceWorker.js` that the `workerDirectory` block produced and the console `.gitignore` entry for a worker nothing generates any more. - `pnpm-lock.yaml` regenerated with `pnpm install --lockfile-only`: the three importer entries go; `msw@2.15.0` stays in the lock as an optional peer of another package, so its transitive entries flip to `optional: true` rather than disappearing. ## Verification (head d1dc66c) - `dispatch-gates --commands` derived 42 families; `--ran` reconciliation: 42 derived, 38 run (all exit 0), 4 NOT MEASURED (exit 3, need whole-tree `dist/`: `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:sourcemap-no-sources-content`), 0 UNRUN. CI's Build/Lint lanes own those four. - `pnpm install --frozen-lockfile` against the new lock: exit 0. - e2e test list (there is no e2e completeness gate; `check-test-completeness` reads vitest logs only): `playwright test --list --project=chromium` → 77 tests in 12 files (one fewer than `main`); `console-rendering.spec.ts` lists its remaining 3 tests. - `check:commit-card-trailers --range origin/main..HEAD` green. - No changeset: only devDependencies and test/config files change; nothing in any package's published output moves. ## Left for a maintainer ruling (out of scope here) - Making the 4-spec live allowlist (`test:e2e:live:ci`) a required check — a new gate. - Moving the informational live lane (`live-e2e.yml`) from every PR to daily only — a governed workflow change. - Triage of the 18 live specs that run in no CI (objectui#13104's list is the starting point). ## Noticed, not changed - `ui/apps/console/vercel.json` still excludes `mockServiceWorker.js` from its SPA rewrite; harmless, left as deploy config. - `ui/.claude/skills/objectui-contributor/guides/console-development.md` still tells contributors to start a mock API with `@objectstack/plugin-msw`, which `docs/upgrading-to-11.md` says was removed. - `console-rendering.spec.ts`'s console-error filter still ignores `MSW` / `mockServiceWorker` messages; inert, left alone. --- _Generated by [Claude Code](https://claude.ai/code/session_01ATRAHgc6RT4GLFAL1N5Zfy)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ATRAHgc6RT4GLFAL1N5Zfy Co-authored-by: Claude <noreply@anthropic.com>
1 parent 712770b commit e0fe7d3

7 files changed

Lines changed: 45 additions & 403 deletions

File tree

‎pnpm-lock.yaml‎

Lines changed: 45 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎ui/apps/console/.gitignore‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,3 @@ plugin.d.ts
2727
*.sln
2828
*.sw?
2929

30-
# MSW
31-
public/mockServiceWorker.js

‎ui/e2e/console-rendering.spec.ts‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,4 @@ test.describe('Console Rendering', () => {
6767
const childCount = await root.evaluate((el) => el.children.length);
6868
expect(childCount, 'React did not mount on deep route').toBeGreaterThan(0);
6969
});
70-
71-
test('should include the MSW service worker in the build output', async ({ page }) => {
72-
// The mock server requires mockServiceWorker.js to be served from /public.
73-
// If it's missing, the app may hang during bootstrap.
74-
const response = await page.request.get(`${CONSOLE_BASE}/mockServiceWorker.js`);
75-
76-
// In production builds without MSW, the asset may be absent. The static
77-
// server returns the SPA fallback (index.html) for unknown paths, which
78-
// is a 200 with `text/html`. Treat that as "MSW not bundled" and skip.
79-
if (response.ok()) {
80-
const contentType = response.headers()['content-type'] || '';
81-
if (contentType.includes('text/html')) {
82-
// SPA fallback — mockServiceWorker.js is not bundled in this build.
83-
return;
84-
}
85-
expect(contentType).toContain('javascript');
86-
}
87-
});
8870
});

‎ui/package.json‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
"globals": "^17.11.0",
150150
"happy-dom": "^20.11.2",
151151
"jsdom": "^29.1.1",
152-
"msw": "^2.15.0",
153152
"playwright": "^1.62.1",
154153
"react": "19.3.0",
155154
"react-dom": "19.3.0",
@@ -171,10 +170,5 @@
171170
"vitest-axe": "^0.1.0",
172171
"wait-on": "^9.5.1",
173172
"yaml": "^2.9.0"
174-
},
175-
"msw": {
176-
"workerDirectory": [
177-
"public"
178-
]
179173
}
180174
}

‎ui/packages/plugin-form/package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"@object-ui/data-objectstack": "workspace:*",
4545
"@object-ui/test-support": "workspace:*",
4646
"@vitejs/plugin-react": "^6.0.5",
47-
"msw": "^2.15.0",
4847
"typescript": "^6.0.3",
4948
"vite": "^8.2.1",
5049
"vite-plugin-dts": "^5.0.3"

‎ui/packages/plugin-grid/package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"@objectstack/spec": "workspace:^",
4949
"@tailwindcss/postcss": "^4.3.3",
5050
"@vitejs/plugin-react": "^6.0.5",
51-
"msw": "^2.15.0",
5251
"postcss": "^8.5.26",
5352
"tailwindcss": "^4.3.3",
5453
"typescript": "^6.0.3",

0 commit comments

Comments
 (0)