-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcommands.test.mjs
More file actions
88 lines (88 loc) · 3.44 KB
/
commands.test.mjs
File metadata and controls
88 lines (88 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import assert from "node:assert/strict";
import { existsSync, readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, it } from "node:test";
import { fileURLToPath } from "node:url";
const __dirname = fileURLToPath(new URL(".", import.meta.url));
const COMMANDS_DIR = join(__dirname, "..", "commands");
describe("commands/discipline.md", () => {
let content = "";
it("exists", () => {
const path = join(COMMANDS_DIR, "discipline.md");
assert.ok(existsSync(path), "discipline.md should exist");
content = readFileSync(path, "utf8");
});
it("has valid frontmatter", () => {
assert.match(content, /^---\r?\n/);
assert.match(content, /name: discipline/);
assert.match(content, /description:/);
});
it("references all 7 laws", () => {
assert.match(content, /Research Before Executing/);
assert.match(content, /Plan Is Sacred/);
assert.match(content, /One Thing at a Time/);
assert.match(content, /Verify Before Reporting/);
assert.match(content, /Reflect After Sessions/);
assert.match(content, /Iterate One Change/);
assert.match(content, /Learn From Every Session/);
});
it("contains red flags", () => {
assert.match(content, /I'll just quickly/);
assert.match(content, /This should work/);
});
it("contains the self-check checklist", () => {
assert.match(content, /Code runs without errors/);
assert.match(content, /Build passes/);
});
});
describe("commands/dashboard.md", () => {
let content = "";
it("exists", () => {
const path = join(COMMANDS_DIR, "dashboard.md");
assert.ok(existsSync(path), "dashboard.md should exist");
content = readFileSync(path, "utf8");
});
it("has valid frontmatter", () => {
assert.match(content, /^---\r?\n/);
assert.match(content, /name: dashboard/);
});
it("contains dashboard display format", () => {
assert.match(content, /Dashboard/);
assert.match(content, /Observations/);
assert.match(content, /Instincts/);
assert.match(content, /Health/);
});
it("references auto-leveling levels", () => {
assert.match(content, /CAPTURE/);
assert.match(content, /ANALYZE/);
assert.match(content, /beginner|expert/);
});
});
describe("commands/continuous-improvement.md", () => {
it("exists", () => {
const path = join(COMMANDS_DIR, "continuous-improvement.md");
assert.ok(existsSync(path), "continuous-improvement.md should exist");
});
});
describe("commands/planning-with-files.md", () => {
let content = "";
it("exists", () => {
const path = join(COMMANDS_DIR, "planning-with-files.md");
assert.ok(existsSync(path), "planning-with-files.md should exist");
content = readFileSync(path, "utf8");
});
it("has valid frontmatter", () => {
assert.match(content, /^---\r?\n/);
assert.match(content, /name: planning-with-files/);
assert.match(content, /description:/);
});
it("references the three planning files and workflow steps", () => {
assert.match(content, /task_plan\.md/);
assert.match(content, /findings\.md/);
assert.match(content, /progress\.md/);
assert.match(content, /init/i);
assert.match(content, /status/i);
assert.match(content, /checkpoint/i);
assert.match(content, /recover/i);
});
});