Unreachable from every app entry and frontend/scripts (dynamic imports counted): chart-basics-tab, error-toast, seven unused shadcn ui files (skeleton among them), three birth-time helpers only tests used, the motion provider shell (it imported motion/react statically), and the two empty people/account stores. Tests that only exercised them are removed or trimmed, each with old/new/reason notes. Unreachable files 18 -> 3 (all kept on purpose); npm test names drop exactly the 4 removed and 1 renamed test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
1.1 KiB
TypeScript
21 lines
1.1 KiB
TypeScript
import assert from "node:assert/strict";
|
||
import { readFileSync } from "node:fs";
|
||
import test from "node:test";
|
||
|
||
import { useSessionStore } from "../src/stores/session-store.ts";
|
||
import { useUiStore } from "../src/stores/ui-store.ts";
|
||
|
||
const home = readFileSync(new URL("../src/app/(app)/page.tsx", import.meta.url), "utf8");
|
||
|
||
test("K0 store skeletons exist and Home() does not move state into them", () => {
|
||
// 原值:Home() 不引用任何一个 store。
|
||
// 新值:Home() 只引用会话 store;人物、账户、界面三个 store 仍是空骨架。
|
||
// 原因:K2 把对话状态放进会话 store,Home() 的 useState 从 33 降到 25。另外三个还没接上。
|
||
assert.equal(useSessionStore.getState().placeholder, true);
|
||
assert.equal(typeof useSessionStore.getState().setSessions, "function");
|
||
// 原值:人物、账户两个 store 也是空骨架;新值:两者从未接上,issue #139 已删除
|
||
assert.equal(useUiStore.getState().placeholder, true);
|
||
assert.match(home, /useSessionStore/);
|
||
assert.doesNotMatch(home, /usePeopleStore|useAccountStore|useUiStore/);
|
||
});
|