Files
ocas/packages/cli/tests/usage-doc.test.ts
T
xiaoju af23c3dce8 chore: 测试框架从 bun:test 迁移到 vitest
- 36 个 test 文件 bun:test → vitest
- Bun.spawn() → execFileSync('tsx', ...)
- Bun.file() → readFileSync
- import.meta.dir → import.meta.dirname (tests) / __dirname (CLI source)
- 删除 bun-types devDep
- 添加 vitest + tsx devDep
- CLI shebang bun → node
- 30/36 test files pass, 558/617 tests pass

Refs #62
2026-06-03 03:52:56 +00:00

20 lines
761 B
TypeScript

import { describe, expect, test } from "vitest";
import { readFileSync } from "node:fs";
import { join } from "node:path";
const usagePath = join(import.meta.dirname, "..", "prompts", "usage.md");
describe("usage.md doc cleanup (D)", () => {
test("D3. usage.md does not reference legacy openStoreAndVarStore / createVariableStore", () => {
const content = readFileSync(usagePath, "utf8");
expect(content).not.toContain("openStoreAndVarStore");
expect(content).not.toContain("createVariableStore");
});
test("D1. usage.md references openStore returning Store", () => {
const content = readFileSync(usagePath, "utf8");
expect(content).toContain("openStore");
expect(content).toMatch(/store\.cas|store\.var|store\.tag/);
});
});